How to implode(reverse of pandas explode) based on a column
问题 I have a dataframe df like below NETWORK config_id APPLICABLE_DAYS Case Delivery 0 Grocery 5399 SUN 10 1 1 Grocery 5399 MON 20 2 2 Grocery 5399 TUE 30 3 3 Grocery 5399 WED 40 4 I want to implode( combine Applicable_days from multiple rows into single row like below) and get the average case and delivery per config_id NETWORK config_id APPLICABLE_DAYS Avg_Cases Avg_Delivery 0 Grocery 5399 SUN,MON,TUE,WED 90 10 using the groupby on network,config_id i can get the avg_cases and avg_delivery like