Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Load, explore, clean, and analyze CSV data with statistical summaries
.claude/skills/brycewang-stanford-csv-data-analyzer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 6% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 39% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 122% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 74% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 23% | 0% |
A comprehensive skill for loading, exploring, cleaning, and analyzing CSV datasets within research workflows. Designed for researchers who need to quickly understand the structure, quality, and statistical properties of tabular data before conducting deeper analysis.
Research datasets commonly arrive as CSV files from instrument exports, survey platforms, government repositories, and collaborator handoffs. This skill provides a structured approach to the entire CSV analysis pipeline: ingestion, profiling, quality assessment, cleaning, transformation, and summary statistics. It emphasizes reproducibility by generating audit logs of every transformation applied to the raw data.
The skill supports datasets of varying complexity, from single-table survey results to multi-file longitudinal study exports with hundreds of columns. It works with standard Python data science libraries (pandas, numpy, scipy) and produces outputs suitable for inclusion in methods sections and supplementary materials.
pythonimport pandas as pd import numpy as np def load_and_profile_csv(filepath: str, encoding: str = 'utf-8') -> dict: """ Load a CSV file and generate an initial data profile. Handles common encoding issues and delimiter detection. """ # Try multiple encodings if default fails encodings = [encoding, 'latin-1', 'utf-8-sig', 'cp1252'] df = None for enc in encodings: try: df = pd.read_csv(filepath, encoding=enc, low_memory=False) break except (UnicodeDecodeError, pd.errors.ParserError): continue if df is None: raise ValueError(f"Could not parse {filepath} with any supported encoding") profile = { 'rows': len(df), 'columns': len(df.columns), 'memory_mb': df.memory_usage(deep=True).sum() / 1e6, 'dtypes': df.dtypes.value_counts().to_dict(), 'missing_pct': (df.isnull().sum() / len(df) * 100).to_dict(), 'duplicates': df.duplicated().sum(), 'column_names': df.columns.tolist() } return df, profile
pythondef infer_semantic_types(df: pd.DataFrame) -> dict: """ Infer semantic column types beyond pandas dtypes. Detects dates, identifiers, categorical, continuous, and text columns. """ semantic_types = {} for col in df.columns: nunique = df[col].nunique() ratio = nunique / len(df) if len(df) > 0 else 0 if ratio > 0.95 and df[col].dtype == 'object': semantic_types[col] = 'identifier' elif nunique <= 20 and df[col].dtype in ['object', 'int64']: semantic_types[col] = 'categorical' elif df[col].dtype in ['float64', 'int64']: semantic_types[col] = 'continuous' elif pd.to_datetime(df[col], errors='coerce').notna().mean() > 0.8: semantic_types[col] = 'datetime' else: semantic_types[col] = 'text' return semantic_types
pythondef clean_column_names(df: pd.DataFrame) -> pd.DataFrame: """Standardize column names to snake_case.""" import re df.columns = [ re.sub(r'[^a-z0-9]+', '_', col.lower().strip()).strip('_') for col in df.columns ] return df def assess_missingness(df: pd.DataFrame) -> pd.DataFrame: """Generate a missingness report for each column.""" report = pd.DataFrame({ 'missing_count': df.isnull().sum(), 'missing_pct': (df.isnull().sum() / len(df) * 100).round(2), 'dtype': df.dtypes }) report['action'] = report['missing_pct'].apply( lambda x: 'drop' if x > 60 else ('impute' if x > 0 else 'ok') ) return report.sort_values('missing_pct', ascending=False)
pythondef generate_statistical_summary(df: pd.DataFrame) -> dict: """ Generate comprehensive descriptive statistics for all columns. Includes measures of central tendency, dispersion, and distribution shape. """ numeric_cols = df.select_dtypes(include=[np.number]) summary = { 'numeric': numeric_cols.describe().T.assign( skewness=numeric_cols.skew(), kurtosis=numeric_cols.kurtosis(), iqr=numeric_cols.quantile(0.75) - numeric_cols.quantile(0.25), cv=numeric_cols.std() / numeric_cols.mean() # coefficient of variation ), 'categorical': { col: df[col].value_counts().head(10).to_dict() for col in df.select_dtypes(include=['object']).columns }, 'correlations': numeric_cols.corr().round(3) } return summary
| Test | Use Case | Function | |------|----------|----------| | Shapiro-Wilk | Normality test (n < 5000) | scipy.stats.shapiro() | | D'Agostino-Pearson | Normality test (n >= 5000) | scipy.stats.normaltest() | | Kolmogorov-Smirnov | Compare to any distribution | scipy.stats.kstest() | | Levene's test | Homogeneity of variance | scipy.stats.levene() |
data_v2_cleaned.csv).random_state parameters consistently for any stochastic operations.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 33,730 | 31,174 | -8% | 1 | 1 | 0% | 5,713 | 5,893 | +3% | 0 | 0 | — |
case-02 | fail→fail | 18,749 | 15,805 | -16% | 1 | 1 | 0% | 3,802 | 5,132 | +35% | 0 | 0 | — |
case-03 | fail→pass | 32,234 | 26,862 | -17% | 1 | 1 | 0% | 6,478 | 6,868 | +6% | 0 | 0 | — |
case-04 | pass→pass | 18,421 | 19,139 | +4% | 1 | 1 | 0% | 3,093 | 5,045 | +63% | 0 | 0 | — |
case-05 | fail→pass | 14,237 | 7,406 | -48% | 1 | 1 | 0% | 2,267 | 3,156 | +39% | 0 | 0 | — |
case-06 | pass→pass | 15,346 | 5,347 | -65% | 1 | 1 | 0% | 2,242 | 2,614 | +17% | 0 | 0 | — |
case-07 | pass→pass | 22,360 | 15,826 | -29% | 1 | 1 | 0% | 4,121 | 4,610 | +12% | 0 | 0 | — |
case-08 | pass→pass | 16,685 | 18,724 | +12% | 1 | 1 | 0% | 2,672 | 5,139 | +92% | 0 | 0 | — |
case-09 | fail→pass | 10,388 | 10,631 | +2% | 1 | 1 | 0% | 1,483 | 3,298 | +122% | 0 | 0 | — |
case-10 | pass→pass | 12,333 | 5,772 | -53% | 1 | 1 | 0% | 1,926 | 2,632 | +37% | 0 | 0 | — |
case-11 | pass→pass | 16,536 | 12,036 | -27% | 1 | 1 | 0% | 2,793 | 3,996 | +43% | 0 | 0 | — |
case-12 | pass→fail | 12,428 | 9,011 | -27% | 1 | 1 | 0% | 1,908 | 3,157 | +65% | 0 | 0 | — |
case-13 | fail→pass | 13,546 | 11,557 | -15% | 1 | 1 | 0% | 2,206 | 3,831 | +74% | 0 | 0 | — |
case-14 | pass→pass | 13,286 | 6,687 | -50% | 1 | 1 | 0% | 2,242 | 2,973 | +33% | 0 | 0 | — |
case-15 | pass→pass | 8,990 | 7,436 | -17% | 1 | 1 | 0% | 1,555 | 3,105 | +100% | 0 | 0 | — |
case-16 | pass→pass | 5,262 | 2,783 | -47% | 1 | 1 | 0% | 898 | 2,165 | +141% | 0 | 0 | — |
case-17 | pass→pass | 14,640 | 6,873 | -53% | 1 | 1 | 0% | 2,406 | 2,907 | +21% | 0 | 0 | — |
case-18 | pass→pass | 10,223 | 10,938 | +7% | 1 | 1 | 0% | 1,651 | 3,294 | +100% | 0 | 0 | — |
case-19 | pass→pass | 14,978 | 17,160 | +15% | 1 | 1 | 0% | 2,309 | 4,701 | +104% | 0 | 0 | — |
case-20 | fail→pass | 10,275 | 2,519 | -75% | 1 | 1 | 0% | 1,731 | 2,131 | +23% | 0 | 0 | — |
case-21 | fail→fail | 20,915 | 20,303 | -3% | 1 | 1 | 0% | 4,188 | 6,202 | +48% | 0 | 0 | — |
case-22 | fail→fail | 26,374 | 29,738 | +13% | 1 | 1 | 0% | 5,199 | 7,869 | +51% | 0 | 0 | — |
case-23 | fail→fail | 27,458 | 38,248 | +39% | 1 | 1 | 0% | 5,972 | 9,978 | +67% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +17 percentage points is the difference between those two pass rates over the 23 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.