python - Sum rainfall over last 60 days in Pandas? -


i'm preprocessing weather data each row 1 day temp, wind, rainfall, etc. i'd compute total rainfall in past 60 days new column.

it seems shift close: rainfall 60 days ago, 59 days ago, etc. possibly create 60 series objects , sum them way feels there's better way.

if df pandas dataframe each row contains values temp, wind, rainfall, etc., can rolling 60 day total follows:

pd.rolling_sum(df, 60) 

Comments

Popular posts from this blog

javascript - Complete OpenIDConnect auth when requesting via Ajax -

java - Get more than One value and display it -

c# - Replace text in MailItem Body -