Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas.util.testing as tm
- # Creating a toy df
- df = tm.makeTimeDataFrame()
- df.index = df.index.map(lambda x: x.map(lambda y: str(y)[:10]))
- # Move an index to desirable location
- selected_index = '2000-02-11'
- selected_row = df[df.index == selected_index]
- df = df.drop(selected_index, axis = 0)
- selected_row.append(df)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement