AttributeError: 'module' object has no attribute 'to_datetime'

1,403 views
Skip to first unread message

karandeep Singh johar

unread,
Feb 18, 2014, 4:15:32 AM2/18/14
to pyd...@googlegroups.com
Hey Guys. i am working on pandas.
i need to change the format of the date 
given format - 2/jun/2011
to be converted to = 2011/06/02
on shell i used
>>> import pandas as pd
>>> obj = pd.read_csv('foo.csv')
>>> obj['date'] = pd.to_datetime(obj['date'], format="%Y/%m/%d")
it work totaly fine and  give the correct result

THE PROBLEM IS 
when is am making a script of that it gives an error 
AttributeError: 'module' object has no attribute 'to_datetime'

i have seen in the mailing list some suggested that to_datetime is not in pandas library but if it is so how it works on shell mode.
i also tries DatetimeIndex it is also not working,,,
Plzz can any1 suggest me something.......

Andy Hayden

unread,
Feb 18, 2014, 12:10:20 PM2/18/14
to pyd...@googlegroups.com
What version of pandas are you using (not sure when this was introduced)...

get it with print(pd.version.version)

On 18 February 2014 01:15, karandeep Singh johar
> --
> You received this message because you are subscribed to the Google Groups
> "PyData" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pydata+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages