I am trying to convert my 15ys worth of daily data into weekly by taking the mean, diff and count of certain features. I tried using .resample but I was not sure if that is the most efficient way.
My sample data:
Date,Product,New Quantity,Price,Refund Flag 8/16/1994,abc,10,0.5, 8/17/1994,abc,11,0.9,1 8/18/1994,abc,15,0.6, 8/19/1994,abc,19,0.4, 8/22/1994,abc,22,0.2,1 8/23/1994,abc,19,0.1, 8/16/1994,xyz,16,0.5,1 8/17/1994,xyz,10,0.9,1 8/18/1994,xyz,12,0.6,1 8/19/1994,xyz,19,0.4, 8/22/1994,xyz,26,0.2,1 8/23/1994,xyz,30,0.1, 8/16/1994,pqr,0,0, 8/17/1994,pqr,0,0, 8/18/1994,pqr,1,1, 8/19/1994,pqr,2,0.6, 8/22/1994,pqr,9,0.1, 8/23/1994,pqr,12,0.2,
This is the output I am looking for: Date,Product,Net_Quantity_diff,Price_avg,Refund 8/16/1994,abc,9,0.6,1 8/22/1994,abc,-3,0.15,0 8/16/1994,xyz,3,0.6,3 8/22/1994,xyz,4,0.15,1 8/16/1994,pqr,2,0.4,0 8/22/1994,pqr,3,0.15,0