0

After doing some operations, I am getting a dataframe with an index and a column with boolean values. I just need to get those indexes having boolean value to be True. How can I get that? My output is like this: Here, "AC name" is the index as per the output dataframe.

 AC name
Agiaon            False
Alamnagar         False
Alauli            True
Alinagar          False
Ziradei           True
Name: Vote percentage, Length: 253, dtype: bool
Mustafa Aydın
  • 17,645
  • 4
  • 15
  • 38
Deepak
  • 59
  • 1
  • 8

1 Answers1

1

Considering that the dataframe is df, it would be:

res = df[df['Vote percentage']].index
ibarrond
  • 6,617
  • 4
  • 26
  • 45