【发布时间】:2020-08-05 22:03:31
【问题描述】:
我试图绘制股票价格,但我遇到了一个小问题:我的图表上的日期有误。
import pandas as pd
from pandas_datareader import data
# Set the start and end date
start_date = '1990-01-01'
end_date = '2019-02-01'
# Set the ticker
ticker = 'AAPL'
# Get the data
data = data.get_data_yahoo(ticker, start_date, end_date)
data.head()
import matplotlib.pyplot as plt
data['Adj Close'].plot()
plt.show()
我得到的不是日期:3960 等。
【问题讨论】:
标签: python date plot charts finance