gpt4 book ai didi

python - 如何使用GOOGLE作为pandas数据阅读器的数据源?

转载 作者:行者123 更新时间:2023-12-04 16:40:07 25 4
gpt4 key购买 nike

我想从 google 源获取数据,但我遇到了一些错误

这是我的代码——

from pandas_datareader import data
import datetime
start=datetime.datetime(2020,1,1)
end=datetime.datetime(2020,6,30)
print(data.DataReader("TSLA",'google',start,end))

我遇到的错误:

NotImplementedError                       Traceback (most recent call last)
<ipython-input-25-a7c6d692c622> in <module>
1 start=datetime.datetime(2020,1,1)
2 end=datetime.datetime(2020,6,30)
----> 3 print(data.DataReader("TSLA",'google',start,end))

c:\users\rishi\appdata\local\programs\python\python38-32\lib\site-packages\pandas\util\_decorators.py in wrapper(*args, **kwargs)
212 else:
213 kwargs[new_arg_name] = new_arg_value
--> 214 return func(*args, **kwargs)
215
216 return cast(F, wrapper)

c:\users\rishi\appdata\local\programs\python\python38-32\lib\site-packages\pandas_datareader\data.py in DataReader(name, data_source, start, end, retry_count, pause, session, api_key)
374 if data_source not in expected_source:
375 msg = "data_source=%r is not implemented" % data_source
--> 376 raise NotImplementedError(msg)
377
378 if data_source == "yahoo":

NotImplementedError: data_source='google' is not implemented

最佳答案

网络上普遍认为“google”作为数据源已经停止。

其他来源,如雅虎和 Alpha Vantage,也能发挥作用。

关于python - 如何使用GOOGLE作为pandas数据阅读器的数据源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62677124/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com