Pratheek Reddy
Pratheek Reddy

Reputation: 1

Attribute error using the quandl module in python27: module object has no attribute 'to_date_time'

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'

Upvotes: 0

Views: 148

Answers (1)

Adeel Ahmad
Adeel Ahmad

Reputation: 1053

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

Upvotes: 0

Related Questions