Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [1]: df = pd.DataFrame({'a': [True, False], 'b': [1, 2]})
- In [2]: df['a'].dtype
- Out [2]: dtype('bool')
- In [3]: df.set_index('a', inplace=True)
- In [4]: df.index
- Out [4]: Index([True, False], dtype='object', name='a')
- In [5]: df.reset_index(inplace=True)
- df.set_index('b', inplace=True)
- df.index
- Out [5]: Int64Index([1, 2], dtype='int64', name='b')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement