I have daily timeseries data that I resampled to weekly data and summed the 'sales' column:
df_weekly = df.resample('W', on='TransxDate').agg({'sales': 'sum'})
How can also get 'count' of sales? If I use
df_weekly = df.resample('W', on='TransxDate').agg({'sales': 'sum', 'sales': 'count'})
I only get the count. If I reverse the order, I only get the sum. I suspect the problem is using the same column name with multiple functions. Is there a way to specify the output column name so that I can perform multiple agg functions on the same column? Or some other solution?