43225/not-able-to-print-cell-value-by-index
Hi. I am trying to print a cell value using the index and the column name. The dataframe is as follows:
Name Age 0 Mike 23 1 Eric 25 2 Donna 23 3 Will 23
Using this code:
print (df.iloc['0'][‘Age’])
But it is not printing anything.
You have wrongly indexed. The index you have to use is an integer 0 but you are using a character ‘0’. Try this:
print (df.iloc[0][‘Age’])
It should work.
Why df.xs('C')['x']=10 does not work: df.xs('C') by default, returns a new ...READ MORE
Use the Counter.most_common() method, it'll sort the items for you: >>> ...READ MORE
To print the message that file is not ...READ MORE
You are using python 2 in which ...READ MORE
You can use the rename function in ...READ MORE
The major difference is "size" includes NaN values, ...READ MORE
key error. I love python READ MORE
Emp_dict=Employee.to_dict('records') You can directly use the 'to_dict()' function ...READ MORE
This would work: d = sorted(data, key = ...READ MORE
Hey. You have to use SpeechRecognition as module ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.