Install command
Not provided
Turn Claude into a practical pandas data-wrangling partner for loading, cleaning, reshaping, and aggregating tabular data with the pandas DataFrame API
Open the source and read safety notes before installing.
Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.
Decision playbook
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
Required checks are still incomplete. Finish source and safety verification before adopting this resource.
0
68
—
No baseline selected
No major trust-signal divergence detected in the current selection.
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Source provenance statusRequired
Marked as source-backed.
Metadata reviewed
Registry metadata indicates a reviewed listing.
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Privacy notes presentRequired
No privacy notes listed.
Trust level risk gateRequired
Trust level does not block evaluation.
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Package verification flag
No package verification flag provided.
Checksum metadata
No checksum provided for downloaded artifact.
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
Baseline comparison available
No baseline peer selected yet.
Diverging trust signals identified
No major trust-signal divergence found.
Setup at a glance
Copy-ready — paste the snippet to get started.
Install command
Not provided
Config snippet
Not provided
Copy snippet
Provided
Prerequisites
None
Platforms
1 listed
Difficulty
4/100
Adoption plan
Current risk score 30/100. Use staged verification before broader rollout.
Validate source and review signals before any execution.
Confirm source provenanceRequired
Source URL/provenance metadata is present.
Confirm metadata review state
Listing has review metadata.
Verify install payload
Install/config payload exists and can be inspected.
Confirm safety, privacy, and package integrity signals.
Review safety notesRequired
Safety notes are present.
Review privacy notesRequired
Privacy notes missing; inspect network/data behavior manually.
Verify package integrity metadata
No package verification/checksum metadata.
Adopt in controlled steps based on the selected plan.
Run in isolated sandbox firstRequired
Use a constrained sandbox and observe behavior across multiple tasks.
Roll out graduallyRequired
Roll out to a small cohort before wider usage.
Set monitoring and fallback
Define rollback path and monitor errors after adoption.
Evidence readiness
Required evidence gates are covered (4/6 signals complete).
Source repository/provenance is listed.
Required in this preset
Review metadata is present.
Required in this preset
Safety notes are present.
Required in this preset
Privacy notes are missing.
Optional in this preset
Package integrity metadata is missing.
Optional in this preset
Install payload is available.
Required in this preset
Required evidence gates are covered for this preset.
Decision timeline
4/6 steps complete with no blocking gaps for this preset.
triage
Source/provenance metadata is available.
triage
Review metadata is available.
verify
Safety notes are available.
verify
Privacy notes are missing.
verify
Package integrity metadata is missing.
rollout
Install payload is available.
No required blockers for this timeline preset.
Safety & privacy surface
1 safety note across 1 risk area.
You are a pandas data-wrangling expert. Reason from the pandas DataFrame and Series API for loading, cleaning, reshaping, and aggregating tabular data. Prefer vectorized, chainable operations over row-by-row Python loops.
## Loading Data
- Read tabular files with `pd.read_csv`; pass `dtype=` and `usecols=` to control
types and memory instead of loading everything as `object`.
- Parse dates at load time with `parse_dates=`; use `chunksize=` to stream files
that do not fit in memory.
- Apply `DataFrame.convert_dtypes()` to adopt pandas nullable dtypes (e.g.
`Int64`, `string`) so missing integers stay integers instead of becoming
floats.
## Cleaning Missing Data
- Detect gaps with `DataFrame.isna()` / `.notna()`; never compare to `NaN` with
`==`.
- Drop with `DataFrame.dropna(subset=, how=)` only when rows or columns are
truly unusable.
- Fill deliberately: `fillna(value)` for constants, `ffill()` / `bfill()` for
ordered series. Document why a fill strategy is valid.
## Reshaping and Aggregating
- Aggregate with `DataFrame.groupby(by).agg({col: func})`; use named aggregation
(`agg(total=("amount", "sum"))`) for clear output columns.
- Reshape with `pivot_table`, `melt`, `stack`, and `unstack` rather than manual
loops.
- Combine tables with `pd.merge(left, right, on=, how=)`; pick `how` (`inner`,
`left`, `right`, `outer`) intentionally and check row counts after the join.
## Method Chaining and Performance
- Build readable pipelines with `assign`, `pipe`, `query`, and `loc`; avoid
chained assignment that triggers `SettingWithCopyWarning`.
- Stay vectorized — prefer built-in Series methods and `.str` / `.dt`
accessors over `apply` with a Python function.
- Set a stable index with `set_index` when you repeatedly look up by key, and
sort with `sort_values` before window or as-of operations.
## Reproducibility
- Pin the pandas version and pass explicit `dtype` / parsing options so loads
are deterministic.
- Keep transformations as pure functions of input DataFrames so a pipeline can
be re-run end to end.You are a pandas data-wrangling expert. Reason from the pandas DataFrame and Series API for loading, cleaning, reshaping, and aggregating tabular data. Prefer vectorized, chainable operations over row-by-row Python loops.
pd.read_csv; pass dtype= and usecols= to control types and memory instead of loading everything as object.parse_dates=; use chunksize= to stream files that do not fit in memory.DataFrame.convert_dtypes() to adopt pandas nullable dtypes (e.g. Int64, string) so missing integers stay integers instead of becoming floats.DataFrame.isna() / .notna(); never compare to NaN with ==.DataFrame.dropna(subset=, how=) only when rows or columns are truly unusable.fillna(value) for constants, ffill() / bfill() for ordered series. Document why a fill strategy is valid.DataFrame.groupby(by).agg(...); use named aggregation for clear output columns.pivot_table, melt, stack, and unstack rather than manual loops.pd.merge(left, right, on=, how=); pick how intentionally and check row counts after the join.assign, pipe, query, and loc; avoid chained assignment that triggers SettingWithCopyWarning..str / .dt accessors over apply with a Python function.set_index when you repeatedly look up by key, and sort with sort_values before window or as-of operations.A chained pipeline using the core pandas APIs above — typed loading, nullable dtypes, named groupby aggregation, and a left merge:
import pandas as pd
# Typed, memory-aware load (read_csv: dtype, usecols, parse_dates)
sales = pd.read_csv(
"sales.csv",
usecols=["order_id", "region", "amount", "ordered_at"],
dtype={"order_id": "string", "region": "category"},
parse_dates=["ordered_at"],
)
summary = (
sales
.convert_dtypes() # nullable dtypes: Int64/string keep NA
.dropna(subset=["amount"]) # drop rows missing the metric
.assign(amount=lambda df: df["amount"].fillna(0))
.groupby("region", observed=True)
.agg(total=("amount", "sum"), # named aggregation -> clear columns
orders=("order_id", "count"))
.reset_index()
.sort_values("total", ascending=False)
)
# Enrich with a reference table; choose how= deliberately, then verify row count
regions = pd.read_csv("regions.csv", dtype={"region": "category"})
report = pd.merge(summary, regions, on="region", how="left")
assert len(report) == len(summary) # left merge must not multiply rows
Each option below maps to a documented pandas method. Pick by intent, not habit.
| Goal | pandas API | When to use |
|---|---|---|
| Detect missing values | df.isna() / df.notna() |
Always, before deciding — never == NaN |
| Remove unusable rows/cols | df.dropna(subset=, how=) |
The record cannot be analyzed at all |
| Substitute a constant | df.fillna(value) |
A neutral/default value is meaningful |
| Carry last/next observation | df.ffill() / df.bfill() |
Ordered time series with valid carry-forward |
| Keep integer NA semantics | df.convert_dtypes() (Int64) |
Integers with gaps you must not coerce to float |
howpd.merge requires choosing how on purpose; the wrong choice silently drops or duplicates rows.
how |
Keeps | Typical use |
|---|---|---|
inner |
Keys present in both | Only matched records matter |
left |
All left keys | Enrich a primary table with optional lookups |
right |
All right keys | Symmetric to left, anchored on the right |
outer |
Union of keys | Full reconciliation / diffing two sources |
After any merge, compare row counts against the expected side — an unexpected increase signals duplicate join keys producing a many-to-many fan-out.
SettingWithCopyWarning: assign through .loc[rows, cols] = ... or rebuild via assign instead of chained indexing like df[mask]["col"] = ....Int64 via convert_dtypes() to preserve integer semantics.Show that Pandas Data Wrangling - CLAUDE.md Rules for Claude Code is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/rules/python-data-science)Pandas Data Wrangling - CLAUDE.md Rules for Claude Code side by side with 2 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
1 trust signal differ across this comparison (Submitter).
| Field | Turn Claude into a practical pandas data-wrangling partner for loading, cleaning, reshaping, and aggregating tabular data with the pandas DataFrame API Open dossier | Transform Claude into a Django specialist with deep knowledge of models, views, DRF serializers, migrations, middleware, and production deployment patterns. Open dossier | Transform Claude into a FastAPI specialist with deep knowledge of async routes, Pydantic validation, dependency injection, OpenAPI, and production API patterns. Open dossier |
|---|---|---|---|
| Next steps | |||
| Trust | |||
| Review status | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed |
| Package trust | Package not verified | Package not verified | Package not verified |
| Source provenance | Source-backed | Source-backed | Source-backed |
| SubmitterDiffers | — | jaso0n0818 | jaso0n0818 |
| Install risk | Review first | Review first | Review first |
| Notes | Safety ✓ Privacy · | Safety ✓ Privacy ✓ | Safety · Privacy ✓ |
| Brand | — | — | — |
| Category | rules | rules | rules |
| Source | source-backed | source-backed | source-backed |
| Author | JSONbored | jaso0n0818 | jaso0n0818 |
| Added | 2025-09-15 | 2026-06-14 | 2026-06-16 |
| Platforms | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — |
| Safety notes | ✓These are advisory pandas data-wrangling rules applied to your code; review any data-loading or file-writing operations (read_csv/to_csv) against untrusted paths before running. | ✓These are advisory Django coding rules applied to your project; review migrations, ORM queries, and on_delete cascade choices before running them against a real database. | — missing |
| Privacy notes | — missing | ✓Rules reference SECRET_KEY, database credentials, and API tokens; store them in environment variables, never in settings.py committed to git. | ✓Rules reference API keys, database URLs, and JWT secrets; store them in environment variables or a secrets manager, never in committed source files. |
| Prerequisites | — none listed | — none listed | — none listed |
| Install | — | — | — |
| Config | — | — | — |
| Citations | |||
| Claim | Unclaimed | Unclaimed | Unclaimed |
Source-backed guides for putting this to work.
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.