Update compliance_heatmap to handle empty dataframes from all sensors
parent
d24c62392a
commit
f7be15ea9e
|
@ -55,7 +55,11 @@ for sensor_path in snakemake.input:
|
|||
else:
|
||||
sensors_five_minutes_row_is = pd.concat([sensors_five_minutes_row_is, sensor_five_minutes_row_is]).groupby("local_date_time").sum()
|
||||
|
||||
|
||||
if sensors_five_minutes_row_is.empty:
|
||||
empty_html = open(snakemake.output[0], "w")
|
||||
empty_html.write("There is no sensor data for " + pid)
|
||||
empty_html.close()
|
||||
else:
|
||||
sensors_five_minutes_row_is.reset_index(inplace=True)
|
||||
# resample again to impute missing dates
|
||||
sensors_five_minutes_row_is_successive = pd.DataFrame(sensors_five_minutes_row_is.resample("5T", on="local_date_time")["has_row"].sum())
|
||||
|
|
Loading…
Reference in New Issue