# pivot-summary

summarise a CSV by one or two columns (sum, count, mean) into a markdown pivot table

- **Space:** data-science-public (https://github.com/Tech-Realm/space-data-science-public/tree/main/pivot-summary)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** python-stdlib, pandas; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use data-science-public/pivot-summary` or MCP `get_pack data-science-public/pivot-summary`
- **Files:** CHANGELOG.md, code/pivot.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/s.csv, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal

Summarise a CSV by one or two columns (sum, count, mean) into a markdown pivot table.

## Steps

1. Choose the question (e.g. sales by region by month).
2. Run pivot.py with rows/cols/value/agg.
3. Paste the markdown into the report.

## Edge cases

- Missing combinations show as empty cells, not zero.
- Non-numeric values in the value column fail loudly.

## Don'ts

- Don't average averages; pivot from raw rows.

## Routes (free first)

1. `python-stdlib`: `code/pivot.py` (no install).
2. `pandas` (free): same job in pandas for large files (pip install pandas)



---

Canonical URL: https://logicpacks.io/packs/data-science-public/pivot-summary

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
