Skip to content

Phase 3: add summary() descriptive statistics - #11

Open
mewincaka wants to merge 17 commits into
kengggg:mainfrom
mewincaka:issue-10-summary
Open

Phase 3: add summary() descriptive statistics#11
mewincaka wants to merge 17 commits into
kengggg:mainfrom
mewincaka:issue-10-summary

Conversation

@mewincaka

Copy link
Copy Markdown
Collaborator

Summary

  • Add epydem.summary(df, by, date_cols, numeric_cols, categorical_cols, top_k, output) for descriptive statistics on epidemiological DataFrames
  • Conservative defaults: returns only n when no column lists are specified (no auto-inference)
  • Metrics: n per group, missingness (missing_n, missing_pct), date (min/max after pd.to_datetime coercion), numeric (count/mean/std/min/p25/median/p75/max), categorical (top-k with deterministic tie-break: count desc, string asc; <NA> token)
  • Output formats: "long" (default) and "wide" (pivoted)

Checklist

  • epydem/summary.py — full implementation
  • epydem/__init__.py — export summary
  • tests/test_summary.py — 21 tests across 6 classes
    • by vs no-by
    • default-only-n behavior
    • date coercion (invalid → missing)
    • numeric quartiles
    • categorical tie-breaking (count desc, string asc)
    • long + wide output formats
  • README examples for summary()
  • All 32 tests green

Test plan

  • Run pytest tests/ — all 32 tests pass (11 existing + 21 new)
  • Verify summary(df) with no column lists returns only n
  • Verify invalid dates like "NOT_A_DATE" are counted as missing after coercion
  • Verify categorical ties are broken deterministically (string ascending)

Closes #10

🤖 Generated with Claude Code

@mewincaka

Copy link
Copy Markdown
Collaborator Author

CI still running ⏳ (pending). PR: #11

1 similar comment
@mewincaka

Copy link
Copy Markdown
Collaborator Author

CI still running ⏳ (pending). PR: #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(new) implementation phase 3: summary()

1 participant