Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. for emisora in emisoras:
  2.  
  3. url = 'http://bit.ly/oncedos-{}'.format(emisora)
  4.  
  5. if emisora == 'ipc':
  6. df = pd.read_csv(url, index_col = 0, parse_dates = True,
  7. usecols = ['Date', 'Close'])
  8.  
  9. df.rename(columns = {'Close': 'PX_LAST'}, inplace = True)
  10.  
  11.  
  12. else:
  13. df = pd.read_csv(url, skiprows = 6, index_col = 0,
  14. parse_dates = True, dayfirst = True,
  15. usecols = ['Date', 'PX_LAST'])
  16.  
  17. df.sort_index(inplace = True)
  18.  
  19. precios_cierre = precios_cierre.join(df['PX_LAST'])
  20. precios_cierre.rename(columns = {'PX_LAST':emisora}, inplace = True)
  21.  
  22.  
  23. del df, url
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement