在雅虎和谷歌倒闭后,我找到一个建议从晨星下载数据的人,但这只会给我5天的价格。我试过不同的日期,但没有办法让它生效。在
我正在使用python3.6.5和PyCharm。在
import datetime
import pandas_datareader.data as web
start = datetime.datetime(2016, 1, 1)
end = datetime.datetime(2016, 1, 10)
df = web.DataReader("AAPL", 'morningstar', start, end)
df.reset_index(inplace=True)
df.set_index("Date", inplace=True)
df = df.drop("Symbol", axis=1)
print(df.head())
我不熟悉python和一般的编码,所以如果有什么我可以更具体的,就告诉我。在
谢谢
只需加入
.head()
因为这意味着要产生前5行。在
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.head.html
相关问题 更多 >
编程相关推荐