I have two multiindex series
series 1
Company Name     Product     Price        TransactionID
Company A        Apple       10           T0001
Company B        Grapes      20           T0002
                 Orange      30           T0003
series 2
Company Name     Product     Price        TransactionID
Company A        Orange      10           T0004
                 Apple       20           T0005
Company B        Orange      20           T0006
I want to form the series like below
Company Name     Product     Sum_price    TransactionID
Company A        Orange      10           [T0004]
                 Apple       30           [T0001,T0005]
Company B        Orange      50           [T0003,T0006]
                 Grapes      20           [T0002]
From Group dataframe and get sum AND count? shows that I can use .agg to do sum and count at the same time, but how to apply .apply(list) and sum together? Right now, I have applied the code Pandas: adding multiindex Series/Dataframes containing lists to form two series one is sum and another one is the one with transactionID. I think I can concat two series together, but I just want to see whether there is a better way to do it.
 
     
    