雅虎财经S& P500数据(^ GSPC)可以追溯到1950年,为什么我只能从1970年开始下载数据?

时间:2017-09-15 06:07:21

标签: python pandas-datareader

import pandas_datareader.data as web

df = web.DataReader('^GSPC', 'yahoo', start='1950-01-03', end='2017-09-14')

如果我访问Yahoo Finance网站,我可以手动从1950年下载数据,那么为什么我不能使用pandas datareader呢?我的意思是我已经获得了数据,只是好奇它为什么不起作用。

编辑:我收到此错误:

Traceback (most recent call last):
  File "C:/Users/x/PycharmProjects/Programming for Finance/getsp.py", line 7, in <module>
    df = web.DataReader('^GSPC', 'yahoo', start='1950-01-03', end='2017-09-14')
  File "C:\Users\x\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas_datareader\data.py", line 121, in DataReader
    session=session).read()
  File "C:\Users\x\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas_datareader\yahoo\daily.py", line 115, in read
    df = super(YahooDailyReader, self).read()
  File "C:\Users\x\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas_datareader\base.py", line 181, in read
    params=self._get_params(self.symbols))
  File "C:\Users\x\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas_datareader\yahoo\daily.py", line 99, in _get_params
    unix_start = int(time.mktime(self.start.timetuple()))
OverflowError: mktime argument out of range

0 个答案:

没有答案