Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- some_dict=defaultdict(dict)
- for x, y, z in zip(val_df['timestamp'].values, val_df['res'], val_df['building_id']):
- some_dict[z][x] = y
- new_col_plus = [some_dict[row['building_id']].get(row['timestamp']+np.timedelta(1, 'W'), np.nan) for (ind, row) in val_df.iterrows()]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement