-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
* Upload one-off script * Update RAPID parser & output file
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Corrects temperatures recorded in farenheit to celsius based on max human internal temperature. | ||
|
||
import pandas as pd | ||
|
||
def convert_temperature_units(value): | ||
if value <= 50: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pipliggins
Author
Collaborator
|
||
return value | ||
elif value > 50: | ||
return (value - 32) * 5/9 | ||
|
||
# import data | ||
df = pd.read_csv("ISARIC RAPID/ISARICCOVID19RAPIDFo_DATA_2022-07-06_0932.csv") | ||
|
||
# create new columns with the converted data | ||
df['temp_vsorres_new'] = df.apply(lambda x: convert_temperature_units(x.temp_vsorres), axis=1) | ||
df['daily_temp_vsorres_new'] = df.apply(lambda x: convert_temperature_units(x.daily_temp_vsorres), axis=1) | ||
|
||
# save the new file | ||
df2 = df.convert_dtypes() | ||
df2.to_csv("ISARIC RAPID/ISARICCOVID19RAPIDFo_DATA_2022-07-06_0932_temperaturefix.csv", index=False) |
Is this limit documented in the source? If units are ambiguous, then I would advise dropping columns entirely, thoughts @sadiekelly? Like here, 50 F ~ 10 Celsius which is very low!