I have a dataframe with a timeseries of sales of different items with customer analytics. For each item and a given day I want to compute: a share of my best customer in last 2 days total sales a share of my top customers (from a list) in last 2 days total sales I’ve tried solutions provided here: for rolling
Tag: rolling-computation
Pandas rolling apply function to entire window dataframe
I want to apply a function to a rolling window. All the answers I saw here are focused on applying to a single row / column, but I would like to apply my function to the entire window. Here is a simplified example: This is df: Take some function to apply to the entire window: In this example, I would