Guest User

Untitled

a guest
Oct 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. histPanel = web.DataReader(STOCKS_PREDICT, 'iex', startDate, endDate)
  2.  
  3. # Cleanse data: remove dates where there is NaN and 0
  4. for item, df in histPanel.iteritems():
  5. for minor, ts in df.iteritems():
  6. for major, value in ts.iteritems():
  7. if float(value) == 0:
  8. histPanel[item][minor][major] = 'NaN'
  9.  
  10. histPanel = histPanel.dropna(axis=1, how='any')
  11.  
  12. return histPanel
Add Comment
Please, Sign In to add comment