Reputation: 1
I'm currently working on a script in python In this part of the script i want to make a loop to get the mean peak value in each window.
df_window['Phasic_mean'] = 0
for a in range(1,len(df_window)-1):
Phasic_mean = np.mean(df_window['Data'][a][0]/df_window_EDA['Data'][a][0])
With the loop above, I only get the last value (from the last window). Can someone help me to make the loop so that I get the value of each window in a dataframe.
Thank you in advance
Upvotes: 0
Views: 463
Reputation: 23825
make sure you collect the calculation result into a data structure. see means
below
menas = []
df_window['Phasic_mean'] = 0
for a in range(1,len(df_window)-1):
means.append(np.mean(df_window['Data'][a][0]/df_window_EDA['Data'][a][0]))
Upvotes: 1