I a trying to get the sum of two numbers by using groupby and transform in pandas library but It is giving some garbage value, can someone guide me on how to solve this: my data looks like this:
SKU     Fees
45241   6.91
45241   6.91
55732   119.05
55732   137.98
I have tried using this code:
df['total_fees'] = df.groupby(['sku'])['Fees'].transform('sum')
what I am getting is this:
SKU     Fees     total_fees 
45241   6.91     6.91.6.91
45241   6.91     6.91.6.91
55732   119.05   119.05.137.98
55732   137.98   119.05.137.98
 
    