import numpy as np
df = pd.DataFrame(np.arange(1, 7).reshape(2, 3), columns=list('abc'), index
    =pd.Series([2, 5], name='b'))
print(df)
print(np.where(df.index == 5)[0])
print(np.where(df['c'] == 6)[0])
Getting the integer index of a Pandas DataFrame row fulfilling a condition?