Skip to main content

showstats: quick and compact summary statistics

showstats quickly produces compact summary statistic tables with vertical orientation.

import duckdb
import pandas as pd
import polars as pl

from showstats import show_stats, table_one
# Daily weather in Seattle, 2012-2015
weather_path = "docs/data/seattle-weather.csv"
df = pl.read_csv(weather_path, try_parse_dates=True)

show_stats(df)
-Date and datetime columns (N=1461)---------------------------------------------
 Col   NA%  Median      Min         Max        
 date  0    2013-12-31  2012-01-01  2015-12-31 
-Numerical columns (N=1461)-----------------------------------------------------
 Col            NA%  Avg    Median  SD    Min   Max  
 precipitation  0    3.03   0.0     6.68  0.0   55.9 
 temp_max       0    16.44  15.6    7.35  -1.6  35.6 
 temp_min       0    8.23   8.3     5.02  -7.1  18.3 
 wind           0    3.24   3.0     1.44  0.4   9.5  
-Categorical columns (N=1461)---------------------------------------------------
 Col      NA%  Uniques  Top 1       Top 2      Top 3    
 weather  0    5        rain (44%)  sun (44%)  fog (7%) 
# Select a table type, columns, or extra quantiles.
show_stats(df, "cat")  # Other options are num and time.
show_stats(df.select("temp_max", "wind"), "num", quantiles=[0.1, 0.9])

Use table_one for a numerical and categorical Table 1 summary. The style can be mean_sd, median_mad, or median_iqr. Use group to report the statistics for each value of another variable.

table_one_df = pl.DataFrame(
    {
        "age": [34.0, 45.0, None, 52.0],
        "score": [7.5, 8.0, 9.5, 7.0],
        "outcome": ["yes", "no", "yes", "yes"],
        "arm": ["control", "control", "treated", "treated"],
    }
)

table_one(table_one_df, style="mean_sd", group="arm")
-Table 1 (N=4)------------------------------------------------------------------
 Col                NA%  Overall       arm = control (N=2)  arm = treated (N=2) 
 age (mean (SD))    25   43.67 (9.07)  39.5 (7.78)          52.0                
 score (mean (SD))  0    8.0 (1.08)    7.75 (0.35)          8.25 (1.77)         
 outcome = yes (%)  0    3 (75%)       1 (50%)              2 (100%)            
 outcome = no (%)        1 (25%)       1 (50%)              0 (0%)              

The NA% column gives the percentage of missing values. Set show_missing=False to omit it. Use n_categories to change the number of categorical values shown.

# Polars detects dates. pandas needs the date column name.
pandas_df = pd.read_csv(weather_path, parse_dates=["date"])
show_stats(pandas_df[["date", "temp_max", "wind"]])

# DuckDB relations are lazy.
duckdb_df = duckdb.read_csv(weather_path).select("date, temp_max, wind")
show_stats(duckdb_df)

Optional Great Tables output

Install the optional package with uv add "showstats[gt]". Set fmt="gt" in show_stats or table_one to return a Great Tables object. Set color_missing=True to add a white to dark gray background scale.

table = show_stats(df, "num", fmt="gt", color_missing=True)
table

Great Tables output

  • showstats works with data frames supported by narwhals, including polars, pandas, and lazy DuckDB relations.

  • Inspired by the R packages skimr and modelsummary.

  • Numbers with many digits are automatically converted to scientific notation.

  • The example above uses Seattle daily weather from vega-datasets (BSD-3-Clause).

  • Fast: under a second to summarise a 1,000,000 × 1,000 data frame on an M1 MacBook.

Metadata

Release files for showstats 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for showstats 0.3.0
File Size Uploaded Provenance Actions
showstats-0.3.0.tar.gz 139.4 kB With provenance Details for showstats-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for showstats 0.3.0
File Interpreter ABI Platform Actions
showstats-0.3.0-py3-none-any.whl Python 3 none any Details for showstats-0.3.0-py3-none-any.whl

Total release size: 161.0 kB

Release files / showstats-0.3.0.tar.gz

Download URL showstats-0.3.0.tar.gz
Size 139.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a51ec5c3229425f35b0b56a1c5fe14f2014877201bba2a637ab6178ddfe47d07
BLAKE2b-256 checksum
How to use checksums
6bbc9b8afdf3821f56595c1f5f08173f2bf229329894de21702913c6ced5067d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release files / showstats-0.3.0-py3-none-any.whl

Download URL showstats-0.3.0-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b15e2bc45ba929da2af2ff66654246482fbcb933e16cc09e1de6dd13b26e1350
BLAKE2b-256 checksum
How to use checksums
f9e879449999ecc4e3b65906c9039be3b8bac076a4bf406d5d43cc7cfdde511d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Security for showstats 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for showstats-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page