1import pandas as pd
2import numpy as np
3
4#1
5df.index[df['BoolCol'] == True].tolist()
6
7#2
8df.index[df['BoolCol']].tolist()
9
10#ex :
11df = pd.DataFrame({'fruit1': np.random.choice(['apple', 'orange', 'banana'], 10),
12 'fruit2': np.random.choice(['apple', 'orange', 'banana'], 10)})
13
14out = df.index[df.fruit1 == df.fruit2].tolist()