# 081. Regional customer basket comparison

**Question:** How does observed total annual spending differ across recorded regions?

## Result

The largest computed metric is 2.803e+04 for 3.0; the smallest is 2.538e+04 for 1.0. Metric: median (Source monetary units).

Region codes remain as documented source categories; unequal samples are not representative market sizes.

![Regional customer basket comparison](outputs/chart.png)

| region | customers | median | p25 | p75 |
| --- | --- | --- | --- | --- |
| 1 | 77 | 2.538e+04 | 1.718e+04 | 3.87e+04 |
| 2 | 47 | 2.695e+04 | 2.061e+04 | 3.616e+04 |
| 3 | 316 | 2.803e+04 | 1.721e+04 | 4.249e+04 |

The chart shows 3 of 3 result rows; the table previews the first 3 in the analysis-defined order. [Download the full result table](outputs/results.csv). Numerical values are computed from the source; missing results stay unavailable.

## Method

Regional sample sizes, medians and quartiles of customer totals.

The study uses shared source preparation and reusable statistical routines. Its specific transformations are in [analysis.py](analysis.py), and common model/evaluation code is in [portfolio/methods.py](../../portfolio/methods.py). The [notebook](analysis.ipynb) executes the study and displays the saved results.

## Decision and limitations

Validate regional coverage before interpreting observed mix as market opportunity.

Annual customer spending uses source monetary units, not an assumed currency. There are no margins, transactions or dates. Customer segments are descriptive and do not establish promotion response. 

Related studies may share observations or holdouts. These are focused analytical studies, not independent replications or deployed business systems. Any model refinements informed by these results need new untouched evaluation data. No commercial impact is inferred from an association or backtest.

## Reproduce

From the repository root, after installing `requirements.txt`:

```powershell
python projects/081-regional-customer-basket-comparison/analysis.py
```

Source data are downloaded automatically if absent. Original archives are retained unchanged and checked by SHA-256. The cleaned cache normalizes column names; field-specific changes are visible in [data preparation](../../portfolio/data.py). Runtime evidence is in [receipt.json](outputs/receipt.json).

## Source

[Wholesale Customers](https://archive.ics.uci.edu/dataset/292/wholesale+customers), Cardoso (2013). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/wholesale.json) and [prepared-data audit](../../data/provenance/wholesale_prepared.json) record the downloaded files, field coverage and hashes.
