Regression - Forecasting and Predicting

by: Adrian55, 7 years ago


Hello,

I am currently working through the Machine Learning tutorials and I'm having trouble with Lesson 05 "Regression - Forecasting and Predicting". My code runs correctly up until:



last_date = df.iloc[-1].name
last_unix = last_date.timestamp()
one_day = 86400
next_unix = last_unix + one_day

for i in forecast_set:
    next_date = datetime.datetime.fromtimestamp(next_unix)
    next_unix += 86400
    df.loc[next_date] = [np.nan for _ in range(len(df.columns)-1)]+[i]



If I run this, I get the following error - "AttributeError: 'Timestamp' object has no attribute 'timestamp'"

I've even copied the exact script from the tutorial and had no luck executing it properly.

Any help would be greatly appreciated.

Kind Regards,
Adrian



You must be logged in to post. Please login or register an account.