1

If I have a pandas data frame like this:

   A  B  C  D  E  
1  3  4  2  5  1
2  5  4  2  4  4
3  5  1  8  1  3
4  1  1  9  9  4
5  3  6  4  1  1

and want to find a value with a row value of 3 and column value of D how do I go about doing it?

In this case, I had a row value of 3 and column value of D how would I get a return of 1 in this instance?

Or if I had a row value of 2 and column value of B how would I get a return of 4?

Zmann3000
  • 806
  • 5
  • 13

1 Answers1

1

You can use DataFrame.loc: df.loc[row, 'col_name'], eg, df.loc[2, 'B'] for 4

kaiserasif
  • 157
  • 8