mardi 11 juin 2019

How to properly download stocks data in python

I have been trying to extract stock prices using pandas_datareader. data, but I kept receiving an error message.

I have checked other threads relating to this problem and, I have tried downloading data reader using conda install DataReader and also tried pip install DataReader.

import pandas as pd

 import datetime

from pandas import Series,DataFrame

import pandas_datareader.data as web

pandas_datareader.__version__

'0.6.0'

start=datetime.datetime(2009,1,1)

end=datetime.datetime(2019,1,1)

df=web.DataReader( 'AT&T Inc T',start,end)

df.head()

My expected result should be a data frame with all the features and rows of the stock.

Below is the error message I got: Please, how do I fix this problem?

Thanks.

<ipython-input-45-d75bedd6b2dd> in <module>


      1 start=datetime.datetime(2009,1,1)

      2 end=datetime.datetime(2019,1,1)

----> 3 df=web.DataReader( 'AT&T Inc T',start,end)

      4 df.head()

~\Anaconda3\lib\site-packages\pandas_datareader\data.py in DataReader(name,

 data_source, start, end, retry_count, pause, session, access_key)

    456     else:

    457         msg = "data_source=%r is not implemented" % data_source

--> 458         raise NotImplementedError(msg)
    459 
    460 

NotImplementedError: data_source=datetime.datetime(2009, 1, 1, 0, 0) is not implemented




Aucun commentaire:

Enregistrer un commentaire