Skip to main content

blame

Cell-level "why" for pandas pipelines. No code changes.

CI PyPI Python License

Your report says 41,900 and it should say 38,400. Today you find that out by adding print statements down a thirty-step pipeline until something looks wrong. blame records the pipeline as it runs, so you can point at the number instead.

clicking the wrong number lights up the rows that made it

Install

pip install pandas-blame

Use

import blame, pandas as pd

with blame.trace():
    orders = pd.read_csv("orders.csv")
    customers = pd.read_csv("customers.csv")
    clean = orders[orders.qty > 0]
    joined = clean.merge(customers, on="customer_id")
    report = joined.groupby("region", as_index=False)["total"].sum()

print(blame.last_run().why(row=1, col="total"))
why(groupby.sum [f5] 3x2, row [1], column 'total')

  derivation:
    step   3 groupby.sum('region') [demo.py:9] <- f4:2 rows
    step   2 merge(on='customer_id') [demo.py:8] <- f3:1 row, f1:2 rows
    step   0 filter(<frame>) [demo.py:6] <- f0:1 row

  source rows:
    read_csv('customers.csv') [f1]: 2 row(s) -> [1, 4]
    read_csv('orders.csv') [f0]: 1 row(s) -> [1]

One order row, but two customer rows: customers.csv has customer_id 11 twice, so the merge duplicated that order and the group-by counted it twice. Two row numbers in two files, not "somewhere in these steps".

blame steps    # every operation the pipeline ran, with line numbers
blame ui       # the picture above: click a cell, watch its sources light up
blame diff     # what changed since the last run, and which input row did it

blame diff is the one that earns its keep in a test suite:

with blame.trace() as before:  # yesterday's run
    report = build_report()
with blame.trace() as after:  # today's, after the data landed
    report = build_report()

assert not before.run.diff(after.run, on="order_id").unexplained_rows()

Inputs that did not move should not produce outputs that did. When they do, blame names the input row responsible — or says plainly that none explains it, which means the pipeline changed rather than the data.

Honest limits

Lineage is exact for filters, slices, sorts, joins, group-bys, resample, concats, pivot, pivot_table, melt, unstack and the row-preserving transforms. It is approximate, and says so with a ~, for apply/map with a user function, and for operations it does not cover (transpose, stack, explode). Approximate answers are widened to every candidate row, never narrowed and never presented as exact — see docs/accuracy.md.

Capture costs about 2x wall time and 5 ms per step on a million rows (benchmarks). Tested on pandas 2.0.3, 2.2.3 and 3.0.5; the eight pandas documentation tutorials run under it with no exceptions, no changed results and no approximate steps (validation).

Status

Alpha, and honest about it. It works, it is tested against ground truth, and it has never been run on your pipeline. If it gets something wrong about a real one, that is the bug report worth filing. Contributing. Roadmap.

Apache-2.0.

Metadata

Release files for pandas-blame 0.1.3

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-blame 0.1.3
File Size Uploaded
pandas_blame-0.1.3.tar.gz 190.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pandas-blame 0.1.3
File Interpreter ABI Platform
pandas_blame-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 241.7 kB

Release files / pandas_blame-0.1.3.tar.gz

Download URL pandas_blame-0.1.3.tar.gz
Size 190.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b4ce8e3cfd6d480c39ff18133014dcda5926ccbf583dd65bbf0947165be34cea
BLAKE2b-256 checksum
How to use checksums
14b50ff7f2f572aa4eb4561c4bb282ff3002aae947d8d4d9811b98bac016f9b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / pandas_blame-0.1.3-py3-none-any.whl

Download URL pandas_blame-0.1.3-py3-none-any.whl
Size 51.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14557dc412259113523972ee2b40095c5560db0b7fc08ad8f7577968d5d86095
BLAKE2b-256 checksum
How to use checksums
888d3902067c6c4c68e24d40a523ed4f76306de0e274d8bcc53086763e61be37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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