daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Mar 18th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Date    Value
  2. 0   2017-07-18 07:40:00 1
  3. 1   2017-07-18 07:45:00 1
  4. 2   2017-07-18 07:50:00 1
  5. 3   2017-07-18 07:55:00 2414
  6. 4   2017-07-18 08:00:00 2
  7. 5   2017-07-18 08:05:00 2
  8. 6   2017-07-18 08:10:00 4416
  9. 7   2017-07-18 08:15:00 4416
  10. 8   2017-07-18 08:20:00 3
  11. 9   2017-07-18 08:25:00 3
  12. 10  2017-07-18 08:30:00 3
  13. 11  2017-07-18 08:35:00 6998
  14.      
  15. df['Value'] = df['Value'].loc[df['Value'].shift() != df['Value']]
  16.      
  17. Date    Value
  18. 0   2017-07-18 07:40:00 1.0
  19. 1   2017-07-18 07:45:00 NaN
  20. 2   2017-07-18 07:50:00 NaN
  21. 3   2017-07-18 07:55:00 2414.0
  22. 4   2017-07-18 08:00:00 2.0
  23. 5   2017-07-18 08:05:00 NaN
  24. 6   2017-07-18 08:10:00 4416.0
  25. 7   2017-07-18 08:15:00 NaN
  26. 8   2017-07-18 08:20:00 3.0
  27. 9   2017-07-18 08:25:00 NaN
  28. 10  2017-07-18 08:30:00 NaN
  29. 11  2017-07-18 08:35:00 6998.0
  30.      
  31. Date    Value
  32. 0   2017-07-18 07:40:00 NaN
  33. 1   2017-07-18 07:45:00 NaN
  34. 2   2017-07-18 07:50:00 NaN
  35. 3   2017-07-18 07:55:00 2414.0
  36. 4   2017-07-18 08:00:00 2.0
  37. 5   2017-07-18 08:05:00 2.0
  38. 6   2017-07-18 08:10:00 4416.0
  39. 7   2017-07-18 08:15:00 4416.0
  40. 8   2017-07-18 08:20:00 NaN
  41. 9   2017-07-18 08:25:00 NaN
  42. 10  2017-07-18 08:30:00 NaN
  43. 11  2017-07-18 08:35:00 6998.0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top