From: Hugo Barnes, head of merchandising at Juniper Lane
Re: Next round of price changes
We changed list prices several times this year (price_history.csv). Before the next round I need to know which categories lose the most units when the price goes up, so we raise prices where customers barely notice and hold them where they do.
weekly_units.csv has units sold per product per week (each week is labeled by its Monday). Compare each product's sales at one price with its sales at the previous price.
Your answer is one of four statements.
The price in effect changes on its own dates, not on week boundaries, so you need merge_asof. Then you average units per price level, compare each level with the one before it within the same product, and turn the two changes into one number per category.
Watch for comparisons that cross from one product into the next, and for price levels that lasted too short a time to trust.