Python

Published:

Variables in names

ED_name = ‘FMC’ filename = “ED_data_{0}_2021.xlsx”.format(ED_name)

Pandas

Pandas subsetting

.loc .at

Pandas: round timestamp to the nearest hour

df.at[read_index, ‘Shift_start’] = 2013-08-01 23:59:00 df.at[read_index, ‘Shift_start’].round(‘H’) = 2013-08-02 00:00:00 df.at[read_index, ‘Shift_start’].hour = 23

Dictionary