I'm trying to solve this and I'm pretty sure the code is right but it keeps getting me the same Error.
I have tried this:
import datetime
from datetime import datetime as datettest_df = shapefile.copy()
test_df['timestamp'] = prediction_time
test_df['allah1__27'] = shapefile.allah1__27.astype('int64')
test_df['hour'] = prediction_time.hour
test_df['weekday'] = prediction_time.weekday()
test_df['month'] = prediction_time.month
def add_join_key(df):df['join_key'] = df.allah1__27.map(int).map(str)+df.timestamp.map(datetime.isoformat)df = df.set_index('join_key')return df
weath_df = wdf.loc[prediction_time]
test_df = add_join_key(test_df)
weath_df = add_join_key(weath_df.reset_index())
And I get this Error:
AttributeError: module 'datetime' has no attribute 'isoformat'
Also I tried:
def add_join_key(df):df['join_key'] = df.allah1__27.map(int).map(str)+df.timestamp.map(datet.isoformat)df = df.set_index('join_key')return df
weath_df = wdf.loc[prediction_time]
test_df = add_join_key(test_df)
weath_df = add_join_key(weath_df.reset_index())
And I get this Error:
AttributeError: DataFrame' object has no attribute 'allah1__27'
Did I miss something?