# Nl Data Analysis

> This skill should be used when the user wants to analyze tabular data or produce charts from natural-language requests. Trigger phrases include "分析这个表", "画个图", "这数据说明什么", "analyze this data", "make a chart", "数据可视化", "跑个分析". It profiles data, translates questions into pandas/SQL, generates charts, and summarizes insights. Trigger on uploads of CSV/Excel or requests to explore/visualize a dataset.

- Skill: `whaojie797-design/nl-data-analysis` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add whaojie797-design/nl-data-analysis`
- Raw SKILL.md: https://api.skillmd.com/api/skills/whaojie797-design/nl-data-analysis/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: whaojie797-design (https://skillmd.com/u/whaojie797-design)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/whaojie797-design/nl-data-analysis

---


# Natural-Language Data Analysis

## Overview
Turn natural-language questions about tabular data into executable analysis:
profile the dataset, translate the question into pandas (or SQL), produce charts,
and summarize insights in plain language.

## When to Use
- "分析这个表", "画个图", "这数据说明什么", "analyze", "make a chart", "数据可视化", "跑个分析", "correlation", "trend".
- The user uploads or points to a CSV, Excel, or database table.
- The user wants a quick exploratory view of a dataset.

## Workflow
1. **Profile** — Load the data; report shape, columns, types, missing counts, head. Use `scripts/profile_data.py` (stdlib, no deps).
2. **Clarify** — If ambiguous (which column? what metric? time range?), ask one focused question. Do not guess silently.
3. **Translate** — Map the question to pandas/SQL (groupby, agg, join, pivot). Prefer pandas for files, SQL for databases.
4. **Visualize** — Generate a chart with `scripts/make_chart.py` (requires `matplotlib`). Choose by intent: trend→line, distribution→hist/box, composition→bar/pie, relationship→scatter.
5. **Summarize** — State the finding in 1-3 sentences; include the number that matters.

## Rules
- Never fabricate statistics. Compute from the actual data.
- One chart per question unless comparing.
- Keep code minimal; load the data once, reuse the DataFrame.
- Save outputs to the working directory; report the path.

## Bundled Resources
- `scripts/profile_data.py` — profile a CSV (shape, columns, missing, head) with no third-party dependencies.
- `scripts/make_chart.py` — generate a chart from a CSV + column spec (install: `pip install matplotlib`).
- `references/analysis-patterns.md` — common NL→pandas translations and chart-selection guidance.

