Guest User

Untitled

a guest
Feb 18th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Index ID V1 V2
  2. 00:00:00 K1 3 4
  3. 00:00:00 K2 4 3
  4. 00:00:00 K17 2 5
  5. 00:00:00 K11 8 6
  6.  
  7. df.index = pd.to_datetime(df.index)
  8.  
  9. Index ID V1 V2
  10. 2019-02-18 00:00:00 K1 3 4
  11. 2019-02-18 00:00:00 K2 4 3
  12. 2019-02-18 00:00:00 K17 2 5
  13. 2019-02-18 00:00:00 K11 8 6
  14.  
  15. df.index = pd.to_timedelta(df.index) + pd.Timestamp('2015-01-20')
  16. print (df)
  17. ID V1 V2
  18. Index
  19. 2015-01-20 K1 3 4
  20. 2015-01-20 K2 4 3
  21. 2015-01-20 K17 2 5
  22. 2015-01-20 K11 8 6
Add Comment
Please, Sign In to add comment