I am trying to compute for the “maximum rainfall” in different durations, say, “1hr” and “3hr” duration.
Using my dataset:
Date Rainfall
2007-01-01 00:00:00 0
2007-01-01 01:00:00 0.5
2007-01-01 02:00:00 0.9
2007-01-01 03:00:00 0.2
…..
2009-01-01 00:00:00 0
2009-01-01 01:00:00 0.4
2009-01-01 02:00:00 0.8
2009-01-01 03:00:00 0.9
If I will set my date range (e.g. 2007-01-01 to 2009-01-01), and I specify it to be maximum “3hr” duration, the computation should look like this (this should be in a for loop, I guess):
Starting at 2007-01-01 00:00:00
, the maximum 3hr is :
0+0.5+0.9=1.4
Then starting at 2007-01-01 01:00:00
, the maximum 3hr is :
0.5+0.9+0.2=1.6
And so on… until it finds the real maximum 3hr duration when it reach 2009-01-01 03:00:00.
I know this needs to have a for loop, I am new to python so I’m still learning. Anyone who can help me shed light about this?