0
votes

For the following code

import quandl
import pandas as pd 

api_key = open('quandlapikey.txt','r').read()

df = quandl.get('FMAC/HPI_AK',authtoken=api_key)

print(df.head())

I am getting this error:

File "/usr/local/lib/python2.7/dist-packages/Quandl-3.1.0-py2.7.egg/quandl/get.py", line 63, in get return data.to_pandas() File "/usr/local/lib/python2.7/dist-packages/Quandl-3.1.0-py2.7.egg/quandl/model/data_mixin.py", line 20, in to_pandas df[self.column_names[0]] = df[self.column_names[0]].apply(pd.to_datetime) AttributeError: 'module' object has no attribute 'to_datetime'

1

1 Answers

0
votes

You need to upgrade your pandas version.

Following this answer:

The to_datetime function was introduced in 0.8.0, so you'll have to upgrade your pandas to use it. Ideally to the latest stable version.

Try using:

pip install pandas --upgrade