Skip to main content

pandas-easy-pivot

Pivot tables with the defaults people actually want — in one call:

from pandas_easy_pivot import easy_pivot

easy_pivot(sales, index="region", columns="product", values="revenue",
           fill=0, margins=True)
        revenue_A  revenue_B  Total
region
N              10         20     30
S               5          7     12
E               3          4      7
W             100          0    100
Total         118         31    149

DataFrame.pivot_table is powerful, but the output almost always needs the same cleanup afterwards: flattening MultiIndex columns, filling the holes, adding totals, turning values into percentages, bucketing the long tail. easy_pivot does that cleanup in the same call.

Install

pip install pandas-easy-pivot

What it does

  • Flat columns by default — revenue_A, revenue_B, never a MultiIndex you have to wrestle before exporting or plotting.
  • fill=0 — fill missing combinations instead of NaN holes.
  • margins=True — a totals row and column, computed after normalization so percentages stay consistent.
  • normalize="index" | "columns" | "all" — row, column, or grand percentages in the same call.
  • top_n=10, other_label="Other" — keep the top categories, bucket the long tail.
  • freq="ME" (or "W", "QE", ...) — group a datetime index column into periods without pre-processing.
  • sort_by_total=True — biggest rows first.
  • dropna=False always — groups are never silently dropped.
  • Multiple values and multiple aggfuncs still come out flat: revenue_sum_A, units_mean_B, ...

Why this exists

AI coding assistants kept telling people to pip install pandas-easy-pivot — confidently, repeatedly, across at least six different models — even though the package didn't exist. So now it does, and it does the thing the name promises. If an assistant sent you here: welcome, this is the real one.

License

MIT

Metadata

Release files for pandas-easy-pivot 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pandas-easy-pivot 0.1.0
File Size Uploaded Provenance
pandas_easy_pivot-0.1.0.tar.gz 6.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pandas-easy-pivot 0.1.0
File Interpreter ABI Platform
pandas_easy_pivot-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / pandas_easy_pivot-0.1.0.tar.gz

Download URL pandas_easy_pivot-0.1.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5a02989371c019335ccb18821b51cce257fa656d3e2a36541cd77f39e4cf4a65
BLAKE2b-256 checksum
How to use checksums
968608998e50772ca631e0b9d66458e3e2820527d26c404d26d62f7c0e4af043
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pandas_easy_pivot-0.1.0-py3-none-any.whl

Download URL pandas_easy_pivot-0.1.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac2c0c809ada1c8d91ac051c695eeea9c09f74c1b9968785b6b2e9cfa09a8500
BLAKE2b-256 checksum
How to use checksums
cc4b6dd05143f6e5c2f7bb82ff26576bbf486a1155805d06793f832c3f9592be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for pandas-easy-pivot 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page