Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import plotly.express as px
- import plotly
- amc = pd.read_csv('amc.csv')
- amc["Name"]= "AMC"
- aapl = pd.read_csv('AAPL.csv')
- aapl["Name"]='AAPL'
- gme = pd.read_csv('gme.csv')
- gme['Name']= 'GME'
- msft = pd.read_csv('MSFT.csv')
- msft['Name']="MSFT"
- tsla = pd.read_csv('TSLA.csv')
- tsla['Name']= "TSLA"
- df = pd.concat([amc,aapl,gme,msft,tsla])
- df=df.drop(['Volume','Open','High','Low'], axis=1)
- print(df)
- #
- price = df['Close/Last']
- name = df['Name']
- date = df['Date']
- fig =px.bar(df,
- x= name,
- y=price,
- color=name,
- animation_frame= date,
- animation_group= name,
- range_y = [0,2000]
- )
- plotly.offline.plot(fig, filename='plot.html')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement