43217/how-to-get-value-in-pandas-dataframe-using-index
Hi. I have the following dataframe:
Name Age 0 Mike 23 1 Eric 25 2 Donna 23 3 Will 23
Now. I have found the index of a particular name and want to print the age separately. I want to print it by using the index. What code should I use for it?
You can use the iloc method to do this. Below is the line of code:
print(df.iloc[0]['Age'])
Why df.xs('C')['x']=10 does not work: df.xs('C') by default, returns a new ...READ MORE
Hello @kartik, Basically instead of raising exception I ...READ MORE
You can use the at() method to ...READ MORE
Hello @kartik, If you need to know how ...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
Try this: for name in df['Name']: ...READ MORE
First, use the dataframe to match the ...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.