Pergunta

That's strange, I have been unable to download future price series from Yahoo! with panda.

Take this snippet which is supposed to download prices for CBoT corn Sept-13 :

import pandas.io.data as fetch
ts = fetch.get_data_yahoo('CU13.CBT', '8/8/2013', '10/8/2013')
print(ts)

I get a weblink error message:

urllib.error.HTTPError: HTTP Error 404: Not Found

I have tried other underlying (metals, livestock ...), and different maturities but that just doesn't work. I have also tried tricks such as removing the .CBT part but with no success

Foi útil?

Solução

It is not a pandas problem, historical data for CU13.CBT is not available, you can check that here you wont find the link to historical prices (compare with this).

Yahoo historical prices

Try with another symbol and it should work. Example:

>>> import pandas.io.data as web

>>> start = datetime.datetime(2013, 8, 8)
>>> end = datetime.datetime(2013, 8, 10)
>>> f = web.DataReader("F", 'yahoo', start, end)
>>> f
             Open    High    Low     Close   Volume      Adj Close
Date                        
2013-08-08   16.94   17.03   16.87   16.98   26589500    16.98
2013-08-09   16.95   17.11   16.94   17.02   25625300    17.02
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top