Loading...
Loading...
Data Analysis provides a structured framework for statistical analysis using pandas, numpy, and scipy, with visualization through matplotlib, seaborn, and plotly.
npx skill4agent add itallstartedwithaidea/agent-skills data-analysisgraph TD
A[Raw Data] --> B[Ingest + Validate Schema]
B --> C[Clean: Missing Values, Outliers, Types]
C --> D[Exploratory Data Analysis]
D --> E[Distribution Assessment]
E --> F{Parametric Assumptions Met?}
F -->|Yes| G[Parametric Tests]
F -->|No| H[Non-Parametric Tests]
G --> I[Effect Size + Confidence Intervals]
H --> I
I --> J[Publication Visualization]
J --> K[Reproducible Report]import pandas as pd
import numpy as np
from scipy import stats
import seaborn as sns
import matplotlib.pyplot as plt
def analysis_pipeline(filepath: str) -> dict:
df = pd.read_csv(filepath)
report = {
"shape": df.shape,
"missing": df.isnull().sum().to_dict(),
"dtypes": df.dtypes.astype(str).to_dict(),
}
numeric_cols = df.select_dtypes(include=[np.number]).columns
for col in numeric_cols:
stat, p = stats.shapiro(df[col].dropna()[:5000])
report[f"{col}_normality"] = {"statistic": stat, "p_value": p, "normal": p > 0.05}
return report
def compare_groups(df: pd.DataFrame, value_col: str, group_col: str) -> dict:
groups = [g[value_col].dropna() for _, g in df.groupby(group_col)]
normality_ok = all(stats.shapiro(g[:5000]).pvalue > 0.05 for g in groups)
_, levene_p = stats.levene(*groups)
homoscedastic = levene_p > 0.05
if normality_ok and homoscedastic:
stat, p = stats.f_oneway(*groups) if len(groups) > 2 else stats.ttest_ind(*groups)
test_name = "ANOVA" if len(groups) > 2 else "t-test"
else:
stat, p = stats.kruskal(*groups)
test_name = "Kruskal-Wallis"
effect = compute_cohens_d(groups[0], groups[1]) if len(groups) == 2 else compute_eta_squared(groups)
return {"test": test_name, "statistic": stat, "p_value": p, "effect_size": effect}
def publication_figure(df: pd.DataFrame, x: str, y: str, output: str):
fig, ax = plt.subplots(figsize=(3.5, 3)) # Single-column journal width
sns.boxplot(data=df, x=x, y=y, palette="colorblind", ax=ax)
ax.set_xlabel(x.replace("_", " ").title())
ax.set_ylabel(y.replace("_", " ").title())
sns.despine()
fig.tight_layout()
fig.savefig(output, dpi=300, bbox_inches="tight")
plt.close(fig)colorblindviridis| Platform | Support | Notes |
|---|---|---|
| Cursor | Full | Jupyter + Python execution |
| VS Code | Full | Jupyter notebook support |
| Windsurf | Full | Python environment |
| Claude Code | Full | Script execution |
| Cline | Full | Data analysis workflows |
| aider | Partial | Code generation only |
data-analysisstatisticspandasscipyvisualizationmatplotlibseabornhypothesis-testingpublication-figures