mask and proper index

diego.avesani at diego.avesani at
Sun Feb 3 10:56:30 EST 2019

Dear all,

I am trying to apply a mask to my dataframe:

mask = (df['datatime'] > start_date) & (df['datatime'] <= end_date)
df = df.loc[mask]

It seems to work pretty well. 

After that I crate the cumulative of its element as:

PP_cumPP = np.cumsum(df[PP_station])

However, I am not able to compute PP_cumPP last element. Indeed, when I do


I get 


and when I try to do:


I get an error.

What I am doing wrong?

Thanks a lot for any kind of help


More information about the Python-list mailing list