I might have been too quick to ask my question xd
I still want to do this
intensity
0.1
0.2
0.1
0.1
0.0
0.0
0.2
And I want to be able to calculate the accumulated rain like this:
0.1
0.2+0.1
0.1+0.3
0.1+0.4
0.0+0.5
0.0+0.5
0.0+0.5
0.0+0.5
0.0+0.5
0.0+0.5
0.2+0.5
And cumsum does this, but I also want to subtract the data with a constant removing rate.
(0.1+()) - 0.1 new dt: 0
(0.2+0)-0.1 0.1
(0.1+0.1)-0.1 0.1
(0.1+0.1)-0.1 0.1
(0.0+0.1)-0.1 0
(0.0+0.0)-0.1 0(dont want it to be negative)
(0.0+0.0)-0.1 0
(0.0+0.0)-0.1 0
(0.0+0.0)-0.1 0
(0.0+0.5)-0.1 0.4
(0.2+0.4)-0.1 0.5
I thought about doing it like this:
I have also tried this, but the problem is that the file I am working with is so large that I need a method as efficient as the cumsum method :/
I still want to do this
intensity
0.1
0.2
0.1
0.1
0.0
0.0
0.2
And I want to be able to calculate the accumulated rain like this:
0.1
0.2+0.1
0.1+0.3
0.1+0.4
0.0+0.5
0.0+0.5
0.0+0.5
0.0+0.5
0.0+0.5
0.0+0.5
0.2+0.5
And cumsum does this, but I also want to subtract the data with a constant removing rate.
(0.1+()) - 0.1 new dt: 0
(0.2+0)-0.1 0.1
(0.1+0.1)-0.1 0.1
(0.1+0.1)-0.1 0.1
(0.0+0.1)-0.1 0
(0.0+0.0)-0.1 0(dont want it to be negative)
(0.0+0.0)-0.1 0
(0.0+0.0)-0.1 0
(0.0+0.0)-0.1 0
(0.0+0.5)-0.1 0.4
(0.2+0.4)-0.1 0.5
I thought about doing it like this:
Vol = vol_added - vol_removed Vol_accc=vol.cumsumAnd that would work if there was a way to reset vol_acc every time I in acc was < 0, but I can't figure out quite how to do to it
I have also tried this, but the problem is that the file I am working with is so large that I need a method as efficient as the cumsum method :/
for i in range(len(volume) - 1): if i >= 0: volume.loc[i] = (volume.loc[i] + volume.loc[i + 1])-vol_out else: i=0Hope you can help me again :)