I have the following DataFrame:
a b c
b
2 1 2 3
5 4 5 6
As you can see, column b
is used as an index. I want to get the ordinal number of the row fulfilling ('b' == 5)
, which in this case would be 1
.
The column being tested can be either an index column (as with b
in this case) or a regular column, e.g. I may want to find the index of the row fulfilling ('c' == 6)
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…