simplebins
simplebins is a lightweight Python utility that makes it easy to bin numeric values into equal-width intervals.
It supports individual numbers, lists and pandas.Series.
Features
- Works with numbers, lists and
pandas.Series - Returns either the bin index, floor, ceiling, midpoint, or a human-readable label
- Clean and intuitive API
- Handles missing values gracefully
- Zero dependencies outside of
pandasandnumpy
Why not pandas.cut()?
pandas.cut() is powerful but sometimes overkill.
simplebins simplifies the common use case: fixed-width bins with predictable, numeric output – perfect for quick transformations.
Installation
pip install simplebins
Usage
from simplebins import cut
Bin a single number
cut(12, binwidth=5)
# Output: 10
Bin a list of numbers
cut([3, 7, 12], binwidth=5)
# Output: [0, 5, 10]
Bin a pandas Series
import pandas as pd
import numpy as np
cut(pd.Series([3, 7, np.nan]), binwidth=5)
# Output:
# 0 0
# 1 5
# 2 nan
# dtype: object
Metadata
Release files for simplebins 0.3.1
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 | |
|---|---|---|---|---|
| simplebins-0.3.1.tar.gz | 2.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simplebins-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.1 kB
Release files / simplebins-0.3.1.tar.gz
| Download URL | simplebins-0.3.1.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88a08df07f2e9eb7cd1d12acd17cfcc03fcdaf0b654d62136ae1bb320e7aff61
|
|
BLAKE2b-256 checksum How to use checksums |
fcb791af45464579629aaa39be4af2e1dae1c898b4ece9cee5349785bcdced2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Oct 13, 2025.
Transparency logRelease files / simplebins-0.3.1-py3-none-any.whl
| Download URL | simplebins-0.3.1-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0302fdc4e13ed1ca88181078a3fd1265944d3aee13aeb6ae6c9b87ec626ac445
|
|
BLAKE2b-256 checksum How to use checksums |
f2da95b5192f5ca5f52d3768838ff1253bd5f042754d304ad5d764c83879e6a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Oct 13, 2025.
Transparency logSecurity for simplebins 0.3.1
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for simplebins-0.3.1.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 Oct 13, 2025.
Transparency logA 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.