(Super simple) Summarisation and Plotting
Introduction
sumplot provides some very simple functionality to discretise, summarise and plot data.
The example below uses the diabetes dataset and summarises the variables s1, s2 and s3 by bp. The bp variable is discretised into buckets with a minimum of 5% of weight per bucket.
import polars as pl
from sklearn.datasets import load_diabetes
from sumnplot.discretisation import EqualWeightDiscretiser
from sumnplot.summarisation import group_by_weighted_average, ResponseWeight
from sumnplot.plot.altair.one_way_summary import produce_one_way_summary_plot
X, _ = load_diabetes(return_X_y=True, as_frame=True)
df = pl.DataFrame(X).with_columns(pl.lit(1).alias("w"))
bp_discretiser = EqualWeightDiscretiser(
column="bp",
weights="w",
min_weight_proportion=0.05,
round_breaks_for_labels=True,
)
bp_discretiser.fit(df)
df = bp_discretiser.transform(df)
results = group_by_weighted_average(
df,
groupby_columns=["bp"],
responses=[ResponseWeight("s1", "w"), ResponseWeight("s2", "w"), ResponseWeight("s3", "w")],
)
chart = produce_one_way_summary_plot(
results,
x_axis_column="bp",
left_y_axis_column="w",
right_y_axis_columns=["s1", "s2", "s3"],
title="One Way Summary by 'bp'",
x_axis_label_angle=90,
)
Install
The easiest way to get sumnplot is directly from pypi using:
pip install sumnplot
Documentation
Documentation can be found at readthedocs.
For information on how to build the documentation locally see the docs README.
Build
sumnplot uses uv as the project management tool.
To install sumnplot for development, first install uv then run the following from the project root:
uv sync
Metadata
Release files for sumnplot 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sumnplot-0.5.0.tar.gz | 13.5 kB | Without provenance | Details for sumnplot-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sumnplot-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for sumnplot-0.5.0-py3-none-any.whl |
Total release size: 34.5 kB
Release files / sumnplot-0.5.0.tar.gz
| Download URL | sumnplot-0.5.0.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8aba79033d3a7e82c8c7a9d172614beb0a6a0eea1aabb1fffb76124ffb8de67d
|
|
BLAKE2b-256 checksum How to use checksums |
87c04074dca79f51a4bdc75fb30b0b0df2cab30e59d9419b42e4c202517543c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Release files / sumnplot-0.5.0-py3-none-any.whl
| Download URL | sumnplot-0.5.0-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a293e5ea7601007ce559019740b7fd90a535e4108e08c911a29c89fec0f213b
|
|
BLAKE2b-256 checksum How to use checksums |
25fb5de5859465edc89a086c629a119f1d750da2e57e2f94a423ea89d3f8925a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.5
|
Security for sumnplot 0.5.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.