晨星数据导入不会给所有日期的价格要求

问题描述 投票:1回答:1

雅虎和谷歌沦陷后,我发现一个人谁建议晨星下载数据,但它只会给我尽可能多5天的价格。从来就试着用不同的日期,但没有办法,使其工作。

即时通讯使用python 3.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和编码一般,所以如果有什么我可以更具体的了解,只是让我知道。

谢谢

python finance
1个回答
1
投票

刚落.head()

print(df.head())

因为这是指产生前5行。

https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.head.html

© www.soinside.com 2019 - 2024. All rights reserved.