Hi Friends ,
i have some aggregation to provide in xlsx files and i need to use a for loop to make it easier
i have columns in dataframe
i want to repeat the same process for all columns using count aggregation with id
for example to obtain the dataframe aggregate_A_B the code is :
kimdly help
regards .
i have some aggregation to provide in xlsx files and i need to use a for loop to make it easier
i have columns in dataframe
df.columns = (id ,a,b,c,d,e,f,j,h)
i want to repeat the same process for all columns using count aggregation with id
for example to obtain the dataframe aggregate_A_B the code is :
aggregate_A_B = df[['a','b']].groupby['id'].count # aggregation with id aggregate_A_B = pd.dataframe (data= aggregate_A_B)# transform to a dataframe aggregate_A_B.to_excel(aggregate_A_B.xlsx) # export to xlsx filei need to repeat the same to get the combination between all columns and i'm thinking about a loop for to save time
kimdly help
regards .