Guest User

Untitled

a guest
Jul 23rd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. import numpy as np
  2. import pandas as pd
  3. ar = np.array([['2018-03-14T10:58:20.000Z', 2],
  4. ['2018-03-14T11:58:20.000Z', 3],
  5. ['2018-03-14T12:58:20.000Z', 2],
  6. ['2018-03-14T13:58:20.000Z', 10],
  7. ['2018-03-14T14:58:20.000Z', 11],
  8. ['2018-03-14T15:58:20.000Z', 12],
  9. ['2018-03-14T16:58:20.000Z', 11],
  10. ['2018-03-14T17:58:20.000Z', 3],
  11. ['2018-03-14T18:58:20.000Z', 2],
  12. ['2018-03-14T19:58:20.000Z', 4],
  13. ])
  14. df = pd.DataFrame(ar, columns = ['Date', 'weight'])
  15. df['Date'] = pd.to_datetime(df['Date'])
  16. df['weight'] = df['weight'].astype(float)
  17.  
  18. df_new = [['2018-03-14T10:58:20.000Z', 2],
  19. ['2018-03-14T11:58:20.000Z', 3],
  20. ['2018-03-14T12:58:20.000Z', 2],
  21. ['2018-03-14T13:58:20.000Z', 2],
  22. ['2018-03-14T14:58:20.000Z', 3],
  23. ['2018-03-14T15:58:20.000Z', 4],
  24. ['2018-03-14T16:58:20.000Z', 3],
  25. ['2018-03-14T17:58:20.000Z', 3],
  26. ['2018-03-14T18:58:20.000Z', 2],
  27. ['2018-03-14T19:58:20.000Z', 4],
  28. ])
Add Comment
Please, Sign In to add comment