Advertisement
g96

Untitled

g96
Apr 4th, 2022
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. import pandas as pd
  2. import plotly.express as px
  3. import plotly
  4.  
  5. amc = pd.read_csv('amc.csv')
  6. amc["Name"]= "AMC"
  7.  
  8. aapl = pd.read_csv('AAPL.csv')
  9. aapl["Name"]='AAPL'
  10.  
  11. gme = pd.read_csv('gme.csv')
  12. gme['Name']= 'GME'
  13.  
  14. msft = pd.read_csv('MSFT.csv')
  15. msft['Name']="MSFT"
  16.  
  17. tsla = pd.read_csv('TSLA.csv')
  18. tsla['Name']= "TSLA"
  19.  
  20. df = pd.concat([amc,aapl,gme,msft,tsla])
  21. df=df.drop(['Volume','Open','High','Low'], axis=1)
  22.  
  23. print(df)
  24. #
  25. price = df['Close/Last']
  26. name = df['Name']
  27. date = df['Date']
  28.  
  29.  
  30. fig =px.bar(df,
  31.                 x= name,
  32.                 y=price,
  33.                 color=name,
  34.                 animation_frame= date,
  35.                 animation_group= name,
  36.                 range_y = [0,2000]
  37. )
  38. plotly.offline.plot(fig, filename='plot.html')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement