Guest User

Untitled

a guest
Jan 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. s = pd.Series({'a': False, 'b': True, 'c': False, 'd': True, 'e': False})
  2.  
  3. >> s
  4. a False
  5. b True
  6. c False
  7. d True
  8. e False
  9. dtype: bool
  10.  
  11. sdict = s.to_dict()
  12. for item in list(sdict):
  13. if sdict[item] == True:
  14. print (item, end=" ")
  15.  
  16. >> b d
  17.  
  18. print (s.index[s])
  19. Index(['b', 'd'], dtype='object')
Add Comment
Please, Sign In to add comment