Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = pd.Series({'a': False, 'b': True, 'c': False, 'd': True, 'e': False})
- >> s
- a False
- b True
- c False
- d True
- e False
- dtype: bool
- sdict = s.to_dict()
- for item in list(sdict):
- if sdict[item] == True:
- print (item, end=" ")
- >> b d
- print (s.index[s])
- Index(['b', 'd'], dtype='object')
Add Comment
Please, Sign In to add comment