Command Palette

Search for a command to run...

Instacart Customer Analytics

completed

SQL and Python analysis of 3.4M Instacart orders covering the funnel, retention, reorder behaviour and basket affinity, plus a simulated A/B test whose design and decision rule were fixed before running anything.

14-day return rate by first basket
Technologies & Frameworks
SQLDuckDBPythonPandasstatsmodelsA/B TestingJupyter

Built on the 2017 Instacart dataset: 206,209 users, 3.4 million orders and about 33.8 million line items. The dataset has no calendar dates, so time is measured from each user's own first order. The analysis is a sequence of DuckDB SQL files, from validation and user timelines to funnel, retention, reorder rates and basket affinity, and every query documents its business question and edge cases. Tests check the SQL against independent pandas calculations.

88.4% of users reach their fifth order and 53.7% their tenth. 32.6% place a second order within 7 days and 55.7% within 14. Dairy and eggs (71.2%), beverages and produce have the highest reorder rates, and personal care the lowest at 34.5%. Ranking basket pairs by lift surfaces substitutes such as flavours of one yogurt line, not cross-sell opportunities, so the write-up reads those results as variety buying.

The A/B test is simulated, because the dataset contains no experiment: a hypothetical reorder reminder, with the 14-day reorder rate as the primary metric and basket size as the guardrail. A 2 percentage point lift needs 9,632 users per arm. Across 2,000 runs the test detected a true 2-point effect in 80.1% of runs, the false positive rate on A/A runs was 4.35%, and the guardrail blocked shipping whenever basket size dropped by an item. The write-up also reports where the checks are weak, such as the sample ratio check missing a 5% post-assignment loss in about 41% of runs.

User funnel by order number
User funnel by order number
Reorder rate by department
Reorder rate by department