Statistics and diagnostics API¶
Reuse descriptive statistics as polars DataFrames, including Table 1 and opt-in dataset diagnostics.
These functions return polars DataFrames. table1 is also available as ps.stats.table1. Functions from polarstory.diagnostics are opt-in and may require costly scans.
| API | Description |
|---|---|
overview |
Dataset-level record count, column count, and null cell count |
missingness |
One row per variable; null and NaN are deliberately not conflated |
frequency |
Top frequency categories, an optional null row, and an Other remainder |
numeric |
One-row numeric summary with null and floating NaN counts separated |
temporal |
One-row summary for Date/Datetime/Time/Duration columns |
text |
Profile text length and emptiness without exporting example strings |
crosstab |
Tidy two-way counts/percentages, with explicit denominator semantics |
summary |
Tidy descriptive summaries, with grouped numeric metrics in one query |
cramers_v |
Bias-corrected or ordinary association between two categorical variables |
correlations |
Pairwise numeric correlations in tidy form (opt-in; never in quick mode) |
outliers |
Count IQR-rule outliers among finite observations of one numeric column |
categorical_diagnostics |
Bounded rare-category and imbalance statistics, without category values |
table1 |
Return a wide, formatted descriptive Table 1 |
missingness_patterns |
Most frequent missingness combinations, with a remainder row |
missingness_associations |
Pairwise phi coefficients between binary missingness indicators |
duplicates |
Exact excess duplicate rows, including the first row in each group once |
uniqueness |
Distinct non-null values and ratios, exact or approximate |