daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pandas as pd
  2. import matplotlib.pyplot as plt
  3.  
  4. ADBE = pd.read_csv(r"C:\Users\Badaboom\Desktop\ADBE.csv", delimiter = ",")
  5. ADBE['Date'] = ADBE['Date'].astype('datetime64[ns]')
  6.  
  7. AA = pd.read_csv(r"C:\Users\Badaboom\Desktop\AA.csv", delimiter = ",")
  8. AA['Date'] = AA['Date'].astype('datetime64[ns]')
  9.  
  10. AXP = pd.read_csv(r"C:\Users\Badaboom\Desktop\AXP.csv", delimiter = ",")
  11. AXP['Date'] = AXP['Date'].astype('datetime64[ns]')
  12.  
  13. AAPL = pd.read_csv(r"C:\Users\Badaboom\Desktop\AAPL.csv", delimiter = ",")
  14. AAPL['Date'] = AAPL['Date'].astype('datetime64[ns]')
  15.  
  16. BA = pd.read_csv(r"C:\Users\Badaboom\Desktop\BA.csv", delimiter = ",")
  17. BA['Date'] = BA['Date'].astype('datetime64[ns]')
  18.  
  19. CAT = pd.read_csv(r"C:\Users\Badaboom\Desktop\CAT.csv", delimiter = ",")
  20. CAT['Date'] = CAT['Date'].astype('datetime64[ns]')
  21.  
  22. CVX = pd.read_csv(r"C:\Users\Badaboom\Desktop\CVX.csv", delimiter = ",")
  23. CVX['Date'] = CVX['Date'].astype('datetime64[ns]')
  24.  
  25. CSCO = pd.read_csv(r"C:\Users\Badaboom\Desktop\CSCO.csv", delimiter = ",")
  26. CSCO['Date'] = CSCO['Date'].astype('datetime64[ns]')
  27.  
  28. #zadanie2
  29. ADBE['Volume'] = ADBE['Volume'] / 1000000000 #в миллиардах
  30. AA['Volume'] = AA['Volume'] / 1000000000
  31. AXP['Volume'] = AXP['Volume'] / 1000000000
  32. AAPL['Volume'] = AAPL['Volume'] / 1000000000
  33. BA['Volume'] = BA['Volume'] / 1000000000
  34. CAT['Volume'] = CAT['Volume'] / 1000000000
  35. CVX['Volume'] = CVX['Volume'] / 1000000000
  36. CSCO['Volume'] = CSCO['Volume'] / 1000000000
  37.  
  38. zadanie2 = pd.DataFrame(index = range(2003,2018), columns = ['Adobe Systems','Alcoa','American Express','Apple','Boeing','Caterpillar','Chevron','Cisco Systems'])
  39. zadanie2['Adobe Systems']= ADBE['Volume'].groupby(ADBE.Date.dt.year).agg('sum').round(1)
  40. zadanie2['Alcoa']= AA['Volume'].groupby(AA.Date.dt.year).agg('sum').round(1)
  41. zadanie2['American Express']= AXP['Volume'].groupby(AXP.Date.dt.year).agg('sum').round(1)
  42. zadanie2['Apple']= AAPL['Volume'].groupby(AAPL.Date.dt.year).agg('sum').round(1)
  43. zadanie2['Boeing']= BA['Volume'].groupby(BA.Date.dt.year).agg('sum').round(1)
  44. zadanie2['Caterpillar']= CAT['Volume'].groupby(CAT.Date.dt.year).agg('sum').round(1)
  45. zadanie2['Chevron']= CVX['Volume'].groupby(CVX.Date.dt.year).agg('sum').round(1)
  46. zadanie2['Cisco Systems']= CSCO['Volume'].groupby(CSCO.Date.dt.year).agg('sum').round(1)
  47.  
  48. #zadanie3
  49. plt.plot(ADBE['Date'], ADBE['Close'])
  50. plt.title('График цены закрытия Adobe Systems')
  51. plt.ylabel('Close')
  52. plt.xlabel('Years')
  53. plt.show()
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