Advertisement
Guest User

Untitled

a guest
Jan 28th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3. import io
  4.  
  5. #----------------------------------------------------------
  6.  
  7. preds = 'test_predictions.json'
  8.  
  9. data = pd.read_json(preds).values
  10.  
  11. df = pd.DataFrame(data)
  12.  
  13. coins = []
  14. old = 'Poloniex_ETH_BTC'
  15. print data[0]
  16. #itterates through all rows in data array and prints the datatime for the first and last prediction for each asset
  17. for i,coin in enumerate(data):
  18. current = coin[0]
  19. if current != old:
  20. print data[i-1][0], pd.to_datetime(int(data[i-1][2]), unit='s'), data[i-1][2]
  21. print coin[0], pd.to_datetime(int(coin[2]), unit='s'), coin[2]
  22. old = current
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement