SHARE
TWEET

Untitled

a guest Jun 25th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pandas as pd
  2.  
  3. df1 = pd.read_csv('c:wamp64wwwstockinfoquotes.csv')
  4.  
  5. df2 = df1.sort_values("Symbol")
  6. df3 = df2.drop_duplicates(subset = "Symbol", keep = 'first')
  7. kolumns = ['Date', 'Symbol','Current Price','Open', 'High',                                                                                   Low','Volume']
  8. df4 = pd.DataFrame(df3, columns=kolumns)
  9. kount = len(df4)
  10. i = 7
  11. for j in range(kount):
  12.     for k in range(i):
  13.         if (k == 0):
  14.             stockdate = pd.to_datetime(df4.iat[j,0], format="%Y-%m-%d")
  15.         if (k == 1):
  16.             f = df4.iat[j,1]+ '.csv'
  17.             theFile = "c:\wamp64\www\stockinfo\historical\" + f
  18.         if (k == 2):
  19.             close = df4.iat[j,2].item()
  20.         if (k == 3):
  21.             open = df4.iat[j,3].item()
  22.         if (k == 4):
  23.             high = df4.iat[j,4].item()
  24.         if (k == 5):
  25.         low = df4.iat[j,5].item()
  26.         if (k == 6):
  27.             volume = df4.iat[j,6].item()
  28.     print(theFile)
  29.     myFile = open("c:\wamp64\www\stockinfo\historical\" + f, "at")    
  30.  
  31.  
  32. c:wamp64wwwstockinfohistoricalABRCX.csv
  33. Traceback (most recent call last):
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top