pandas get value from dataframe row code example
Example 1: pandas get row from column value
df.loc[df['column_name'] == some_value]
Example 2: df fetch value
In [3]: sub_df
Out[3]:
A B
2 -0.133653 -0.030854
In [4]: sub_df.iloc[0]
Out[4]:
A -0.133653
B -0.030854
Name: 2, dtype: float64
In [5]: sub_df.iloc[0]['A']
Out[5]: -0.13365288513107493
Example 3: loc and iloc in pandas
iloc - default indexes (system generated)
loc - table indexes or we manually given indexes