Finding label location in a DataFrame Index

You’re looking for the index method get_loc:

In [11]: df.index.get_loc(ds)
Out[11]: 1

Leave a Comment