get index number pandas dataframe

df.index[df['BoolCol'] == True].tolist()

Here is what the above code is Doing:
1. We’re creating a list of all the indices where the value in the ‘BoolCol’ column is True.
2. We’re using that list to filter the original DataFrame.
3. We’re assigning the resulting DataFrame to the df variable.