【发布时间】:2019-09-11 09:11:40
【问题描述】:
我可以从雅虎读取“AAPL”符号历史数据
dfcomp3 = web.DataReader(["AAPL"],'yahoo',start=start,end=end)['Adj Close']
我可以从雅虎读取“GE”符号历史数据
dfcomp3 = web.DataReader(["AAPL"],'yahoo',start=start,end=end)['Adj Close']
我可以从雅虎读取“BTC-USD”符号历史数据
dfcomp3 = web.DataReader(["BTC-USD"],'yahoo',start=start,end=end)['Adj Close']
我可以从雅虎读取“AAPL”、“GE”符号历史数据
dfcomp7 = web.DataReader(["GE", "AAPL"],'yahoo',start=start,end=end)['Adj Close']
我无法从雅虎读取“AAPL”、“BTC-USD”符号历史数据
dfcomp7 = web.DataReader(["BTC-USD", "AAPL"],'yahoo',start=start,end=end)['Adj Close']
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-58-0cbbb3aa9346> in <module>()
----> 1 dfcomp7 = web.DataReader(["BTC-USD", "AAPL" ],'yahoo',start=start,end=end)['Adj Close']
7 frames
/usr/local/lib/python3.6/dist-packages/pandas/core/reshape/reshape.py in _make_selectors(self)
164
165 if mask.sum() < len(self.index):
--> 166 raise ValueError('Index contains duplicate entries, '
167 'cannot reshape')
168
ValueError: Index contains duplicate entries, cannot reshape
为什么?
【问题讨论】:
标签: python pandas api yahoo pandas-datareader