I have 3 columns in my dataframe, date time and snowfall. The snowfall data needs transforming from kg m-3 s-1 to mm/day. To do this, I divide by the density of snow and multiply by seconds in the day. (n/70)*86400
I would like to do this by overwriting the the snowfall column in the dataframe with the calculation for plotting.
I have the loop function which transforms the values but will not append the result to the list (which is the basic version of what I was looking for), but ideally I would like to have it simply overwrite the column in the dataframe for ease of plotting.
def snowfallconverter(in1):
snowfall_fix = []
for ii in in1:
snowfall_mm = (ii/70)*8600
snowfall_fix.append(snowfall_mm)
The dataset looks like:
date time snowfall
01/11/2017 12:00:00 -4.43e-06
02/11/2017 12:00:00 -9.04e-08
Thank you in advance.