Feb-14-2022, 11:10 AM
Hello, I am working with a time series containing rain. the data looks like
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.2+0.5
Hope someone can help ☺
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.2+0.5
for i in range(len(Needed_vol) - 1): Needed_vol.loc[i + 1] = Needed_vol.loc[i] + Needed_vol.loc[i + 1]So far I am doing it like this, and it works fine, it does, however, take too much time, as I am working with a file containing more than 10000 timestamps, so I would like to know if there is a way to do this more efficiently. It is important that it sums it up like the example
Hope someone can help ☺