Skip to content

commandData and AIpython

Analyze CSV

Loads a CSV, profiles every column and its quality problems, and summarizes the data with a few plots saved to disk.

npx workspacetemplates add analyze-csv --tool claude-code

Writes 1 file to .claude/commands/

.claude/commands/analyze-csv.md14 lines · 1.2 KBFile
---
description: Loads a CSV, profiles every column and its quality problems, and summarizes the data with a few plots saved to disk.
argument-hint: "[path to the csv file]"
---

Analyze the CSV at: $ARGUMENTS

1. Confirm the file exists and print its size and first 5 lines raw, so delimiter, encoding and header problems show up. Never modify the source file.
2. Load it with pandas (`pd.read_csv`, pass `sep`, `encoding` and `dtype` as needed). Report rows, columns, memory use.
3. Profile each column: inferred type, null count and percent, distinct count, min, max, mean and top values. Flag mixed types, dates stored as text, numbers with currency symbols, and IDs that are not unique.
4. Check quality: exact duplicate rows, impossible values (negative ages, future birthdates), outliers beyond 3 standard deviations, inconsistent casing or trailing spaces.
5. Write 3 to 5 plots with matplotlib into `./csv-analysis/`: missingness bar, the main numeric distributions, one category count, and one relationship worth seeing.

Finish with a short summary: what each row represents, the three biggest problems, and suggested cleaning steps. Do not clean anything until asked.

What it does

A new data file deserves a quick honest look before anyone builds on it. This command loads the CSV, guesses types, counts missing values and duplicates, and flags columns that look wrong.

It then writes a short summary of what the file contains and saves a handful of plots next to it. Your original file is never modified.

Example

you › /analyze-csv data/orders_2026.csv

agent › 48,210 rows, 14 columns. Each row is one order line.
Problems: 6% of ship_date missing, 312 duplicate order_id rows, price stored as text with a $ sign.
Plots saved in csv-analysis/ (5 files). Shall I write a cleaning script?

Questions

Does it change my CSV?
Never. It reads the file and writes only the plots into a separate output folder.
What about very large files?
It samples or reads in chunks when the file is big and says that the numbers come from a sample.
  • Clean Notebook

    Commandpython

    Free
  • Eval Prompt

    CommandData and AI

    Free
  • Profile DataFrame

    Commandpython

    Free
  • SQL From Question

    CommandData and AI

    Free