Skip to content Skip to sidebar Skip to footer

Attributeerror: 'numpy.int64' Object Has No Attribute 'timestamp' In Python 3.5 In Anaconda

I am a newbie in learning Machine Learning, so following a great tutorial in YouTube. But the following code is giving me an error. I read a similar question in here, but timetuple

Solution 1:

It seems it doesn't index the rows by the dates. So when you are trying to get last_date, actually it is getting int instead of date.

As per my understanding you can add date index by using the following line after reading csv code - df.set_index('date', inplace=True)

Solution 2:

Replace last_date.timestamp() with time.mktime(datetime.datetime.strptime(last_date,"%d%m%y").timetuple())

Solution 3:

Hi sometimes when do such operations index is changed. Date column is no more index.

df=df.set_index('Date')

Just add this just after you create a dataframe. Example- df = quandl.get_table('WIKI/PRICES') OR df=pd.read_csv("stock_data.csv") add after this.

Post a Comment for "Attributeerror: 'numpy.int64' Object Has No Attribute 'timestamp' In Python 3.5 In Anaconda"