Pingouin Excel Statistical Analysis
Trigger
- •Use for statistical analysis tasks (hypothesis tests, post-hoc tests, and summary tables) where the final deliverable is an Excel workbook.
- •Trigger for requests mentioning either
pingouinor typo variants likepinguoin. - •In
analysis/, if users want to try statistical analysis or aggregation directly, treat notebook-first exploration plus Python-script Excel generation as the preferred pattern. - •For
stepvsnonstepEMG rank interpretation workflows inanalysis/, co-useanalysis-step-nonstep-rank-reportand let that skill drive folder/report structure while this skill owns tests and Excel table rules. - •In this repository, for statistical ranking/hypothesis-result requests (even when users do not explicitly say "Excel"), default deliverables should include:
- •reproducible
.pyanalysis code, and - •an
.xlsxworkbook (tables+table_guide) for review/validation.
- •reproducible
Non-Negotiable Rules
- •Use
pingouinfor statistical testing (friedman,anova,pairwise_tests, and related functions). - •Prefer
polarsfor data preparation, then convert topandasonly when a statistics API requires it. - •Write Excel outputs with
xlwingsin Windows PowerShell or cmd. - •Use
.xlsxas the default output format (use.xlsmonly when macro requirements are explicitly requested). - •For
analysis/statistical or aggregation tasks, prefer:- •
.ipynbfor exploratory aggregation/statistical iteration. - •
.pyfor final Excel workbook generation. - •This is a preferred workflow, not a global hard requirement for every task.
- •
- •Save user-facing results as Excel Tables (
ListObject), not loose ranges. - •Keep sheet count minimal. Default layout:
- •
tables: all result tables. - •
table_guide: metadata and explanation for each table.
- •
- •Every output table must have a matching
table_guiderow with a non-emptydescription.
Table Guide Schema
- •
table_name - •
sheet_name - •
table_range - •
description - •
key_columns - •
filters_or_notes
Workflow
- •Define hypotheses and required output tables before coding.
- •In
analysis/statistical or aggregation exploration, iterate in.ipynbfirst when useful. - •Load and clean data in
polars. - •Convert only required frames to
pandas. - •Compute statistics with
pingouin. - •Move final Excel-generation logic into a
.pyscript. - •Write each result block to
tablesand convert ranges to Excel Tables. - •Populate
table_guidewith interpretation notes. - •Reopen workbook and validate errors, blanks, and table-guide integrity.
Validation
- •Fail if any cell contains
#DIV/0!,#N/A,#NAME?,#NULL!,#NUM!,#REF!, or#VALUE!. - •Fail if expected tables are missing.
- •Fail if
table_guideis missing or has blankdescriptionvalues. - •Fail if business-critical required ranges are blank.
Command Templates
NOTE: scripts/run_stats_report.py is a placeholder example path (this repo may not include that file). Replace it with your actual stats-report script under scripts/.
PowerShell:
- •
conda run -n module python -c "import pingouin, xlwings; print('ok')" - •
conda run -n module python .\scripts\run_stats_report.py
cmd:
- •
conda run -n module python -c "import pingouin, xlwings; print('ok')" - •
conda run -n module python scripts\run_stats_report.py
Completion Checklist
- •Report workbook path.
- •Report final sheet count and rationale if more than two sheets.
- •List created table names.
- •Confirm
table_guidedescriptions were added for all tables. - •Report validation results.