I have to find the row and column index of the particular value from the dataframe. I have the code to find the row index based on the column name. But not sure how to find both row and column indexes.
Current Table:
0 | 1 | 2 | 3 | 4 |
---|---|---|---|---|
VT1 | Date | Time | Glen | 1600 |
VT2 | 04/16 | 4:00 | Cof | 1600 |
VT3 | 04/18 | 5.00 | 1750 | NAN |
VT4 | 04/19 | 7.00 | 1970 | NAN |
From the above table, need to find the row and column index of the value 'Date'.
Code to find row index based on column:
print(df[df[1]=='Date'].index.values)
But we need to find the both the indexes without giving column name.