Data Exploration Skill
Systematic methodology for profiling datasets, assessing data quality, discovering patterns, and understanding schemas.
Data Profiling Methodology
Phase 1: Structural Understanding
Before analyzing any data, understand its structure:
Table-level questions:
- How many rows and columns?
- What is the grain (one row per what)?
- What is the primary key? Is it unique?
- When was the data last updated?
- How far back does the data go?
Column classification:
- Identifier: Unique keys, foreign keys, entity IDs
- Dimension: Categorical attributes for grouping/filtering
- Metric: Quantitative values for measurement
- Temporal: Dates and timestamps
- Text: Free-form text fields
- Boolean: True/false flags
- Structural: JSON, arrays, nested structures
Phase 2: Column-Level Profiling
For each column, compute:
All columns:
- Null count and null rate
- Distinct count and cardinality ratio
- Most common values (top 5-10 with frequencies)
- Least common values (bottom 5 to spot anomalies)
Numeric columns:
- min, max, mean, median (p50)
- standard deviation
- percentiles: p1, p5, p25, p75, p95, p99
- zero count, negative count
String columns:
- min length, max length, avg length
- empty string count
- pattern analysis, case consistency
Date/timestamp columns:
- min date, max date, null dates
- future dates (if unexpected)
- distribution by month/week, gaps in time series
Phase 3: Relationship Discovery
- Foreign key candidates: ID columns that might link to other tables
- Hierarchies: Columns that form natural drill-down paths
- Correlations: Numeric columns that move together
- Derived columns: Columns that appear to be computed from others
- Redundant columns: Columns with identical or near-identical information
Quality Assessment Framework
Completeness Score
- Complete (>99% non-null): Green
- Mostly complete (95-99%): Yellow - investigate the nulls
- Incomplete (80-95%): Orange - understand why
- Sparse (<80%): Red - may not be usable without imputation
Consistency Checks
- Value format inconsistency ("USA", "US", "United States")
- Type inconsistency: Numbers stored as strings, dates in various formats
- Business rule violations: Negative quantities, end dates before start dates
- Cross-column consistency: Status = "completed" but completed_at is null
Accuracy Indicators
Red flags:
- Placeholder values: 0, -1, 999999, "N/A", "TBD", "test"
- Default values: Suspiciously high frequency of a single value
- Stale data: Updated_at shows no recent changes
- Impossible values: Ages > 150, dates in the far future
Pattern Discovery
Distribution Analysis
- Normal: Mean and median are close, bell-shaped
- Skewed right: Long tail of high values (common for revenue)
- Power law: Few very large values, many small ones
- Bimodal: Two peaks (suggests two distinct populations)
Temporal Patterns
- Trend, seasonality, day-of-week effects, holiday effects
- Change points: Sudden shifts in level or trend
- Anomalies: Individual data points that break the pattern
Schema Documentation Template
## Table: [schema.table_name]
**Description**: [What this table represents]
**Grain**: [One row per...]
**Primary Key**: [column(s)]
**Row Count**: [approximate, with date]
**Update Frequency**: [real-time / hourly / daily / weekly]
### Key Columns
| Column | Type | Description | Example Values | Notes |
|--------|------|-------------|----------------|-------|
| user_id | STRING | Unique user identifier | "usr_abc123" | FK to users.id |
### Known Issues
- [List any known data quality issues]
1---2name: data-exploration3description: Profile and explore datasets to understand their shape, quality, and patterns before analysis. Use when encountering a new dataset, assessing data quality, discovering column distributions, identifying nulls and outliers, or deciding which dimensions to analyze.4---56# Data Exploration Skill78Systematic methodology for profiling datasets, assessing data quality, discovering patterns, and understanding schemas.910## Data Profiling Methodology1112### Phase 1: Structural Understanding1314Before analyzing any data, understand its structure:1516**Table-level questions:**17- How many rows and columns?18- What is the grain (one row per what)?19- What is the primary key? Is it unique?20- When was the data last updated?21- How far back does the data go?2223**Column classification:**24- **Identifier**: Unique keys, foreign keys, entity IDs25- **Dimension**: Categorical attributes for grouping/filtering26- **Metric**: Quantitative values for measurement27- **Temporal**: Dates and timestamps28- **Text**: Free-form text fields29- **Boolean**: True/false flags30- **Structural**: JSON, arrays, nested structures3132### Phase 2: Column-Level Profiling3334For each column, compute:3536**All columns:**37- Null count and null rate38- Distinct count and cardinality ratio39- Most common values (top 5-10 with frequencies)40- Least common values (bottom 5 to spot anomalies)4142**Numeric columns:**43- min, max, mean, median (p50)44- standard deviation45- percentiles: p1, p5, p25, p75, p95, p9946- zero count, negative count4748**String columns:**49- min length, max length, avg length50- empty string count51- pattern analysis, case consistency5253**Date/timestamp columns:**54- min date, max date, null dates55- future dates (if unexpected)56- distribution by month/week, gaps in time series5758### Phase 3: Relationship Discovery5960- **Foreign key candidates**: ID columns that might link to other tables61- **Hierarchies**: Columns that form natural drill-down paths62- **Correlations**: Numeric columns that move together63- **Derived columns**: Columns that appear to be computed from others64- **Redundant columns**: Columns with identical or near-identical information6566## Quality Assessment Framework6768### Completeness Score6970- **Complete** (>99% non-null): Green71- **Mostly complete** (95-99%): Yellow - investigate the nulls72- **Incomplete** (80-95%): Orange - understand why73- **Sparse** (<80%): Red - may not be usable without imputation7475### Consistency Checks7677- Value format inconsistency ("USA", "US", "United States")78- Type inconsistency: Numbers stored as strings, dates in various formats79- Business rule violations: Negative quantities, end dates before start dates80- Cross-column consistency: Status = "completed" but completed_at is null8182### Accuracy Indicators8384Red flags:85- Placeholder values: 0, -1, 999999, "N/A", "TBD", "test"86- Default values: Suspiciously high frequency of a single value87- Stale data: Updated_at shows no recent changes88- Impossible values: Ages > 150, dates in the far future8990## Pattern Discovery9192### Distribution Analysis9394- **Normal**: Mean and median are close, bell-shaped95- **Skewed right**: Long tail of high values (common for revenue)96- **Power law**: Few very large values, many small ones97- **Bimodal**: Two peaks (suggests two distinct populations)9899### Temporal Patterns100101- Trend, seasonality, day-of-week effects, holiday effects102- Change points: Sudden shifts in level or trend103- Anomalies: Individual data points that break the pattern104105## Schema Documentation Template106107```108## Table: [schema.table_name]109110**Description**: [What this table represents]111**Grain**: [One row per...]112**Primary Key**: [column(s)]113**Row Count**: [approximate, with date]114**Update Frequency**: [real-time / hourly / daily / weekly]115116### Key Columns117118| Column | Type | Description | Example Values | Notes |119|--------|------|-------------|----------------|-------|120| user_id | STRING | Unique user identifier | "usr_abc123" | FK to users.id |121122### Known Issues123- [List any known data quality issues]124```