python - How to find correcet ticker for pandas web reades? (google) -


hi trying data on index google finance.

the ticker is: indexdjx:djsphm or djsphm.

i using code, , have tried variious combinations of tickers, nothing work. data readily available on website. not issue. if write ticker, fx google, data fetched perfectly.

import pandas.io.data web import datetime start = datetime.datetime(2010, 1, 1) end = datetime.datetime(2013, 1, 27) f = web.datareader("f", 'indexdjx:djsphm', start, end) 

can help? thanks

here's fix: f = web.datareader('djsphm', "yahoo", start, end)

you have 2 problems

  1. the argument order incorrect (ticker first, data_source second). original posted code looks ticker "f" on source "indexdjx:djsphm". "if write ticker, fx google, data fetched perfectly.", getting ticker f google. @ least on pandas master, not complain if source not 1 of working sources ("google", "yahoo", "fred", "famafrench"), returns nothing. last line should be:

    f = web.datareader("indexdjx:djsphm", "google", start, end)

  2. google in fact has problem retrieving dates djsphm. here's error you'll get:

    ioerror: after 3 tries, google did not return 200 url 'http://www.google.com/finance/historical?q=indexdjx%3adjsphm&startdate=jan+01%2c+2010&enddate=jan+27%2c+2013&output=csv'

    however yahoo works fine. f = web.datareader('djsphm', "yahoo", start, end)


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -