Loop over pandas dataframe and group by data

I think you need filter 11th column by boolean indexing before aggregate sum, loops by itertuples here are not necessary:

df_ = df_data[df_data.iloc[:, 10] == 1]
df1 = df_.groupby([df_['Data'].dt.date])['ValueAnalysisPerDay'].sum()

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top