Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import pandas as pd
- file = '../stocks.csv'
- stock = pd.read_csv(file, parse_dates=['Date'], index_col=['Date'])
- plt.plot(stock.index, stock['AAPL'], color='red', label='Apple')
- plt.plot(stock.index, stock['MSFT'], color='blue', label='Microsoft')
- plt.xlabel('Date')
- plt.ylabel('Stock price')
- plt.title('Stock price in 2000')
- plt.legend(loc='best')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment