Nov-28-2018, 02:29 PM
I have rain data with 15 minutes interval, like this:
[yyyy mm dd hh mm rain_value]
2017 1 1 0 0 0.2
2017 1 1 0 15 0.4
2017 1 1 0 30 2.1
2017 1 1 0 45 0
2017 1 1 1 0 0
2017 1 1 1 15 1.3
[...]
And I need to accumulate every rain_value along the time serie making rain events.
But when I have 24 hour with no rain (rain_value = 0), I need to write start and end of rain event and start a new sum when starts to rain again, getting something like this:
Start_Event End_event Accumulated_Rain
'2017-1-1 0:0' '2017-1-4 12:45' 36.2
'2017-1-6 4:15' '2017-1-12 19:45' 43.2
What's the easier way to code this on python?
Thanks
[yyyy mm dd hh mm rain_value]
2017 1 1 0 0 0.2
2017 1 1 0 15 0.4
2017 1 1 0 30 2.1
2017 1 1 0 45 0
2017 1 1 1 0 0
2017 1 1 1 15 1.3
[...]
And I need to accumulate every rain_value along the time serie making rain events.
But when I have 24 hour with no rain (rain_value = 0), I need to write start and end of rain event and start a new sum when starts to rain again, getting something like this:
Start_Event End_event Accumulated_Rain
'2017-1-1 0:0' '2017-1-4 12:45' 36.2
'2017-1-6 4:15' '2017-1-12 19:45' 43.2
What's the easier way to code this on python?
Thanks