Get the index corresponding to True boolen values only

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


Read more here: https://stackoverflow.com/questions/67939673/get-the-index-corresponding-to-true-boolen-values-only

Content Attribution

This content was originally published by Deepak at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: