Skip to main content

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 pandas and numpy

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)

Source distribution for simplebins 0.3.1
File Size Uploaded Provenance
simplebins-0.3.1.tar.gz 2.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for simplebins 0.3.1
File Interpreter ABI Platform
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 log

Release 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 log

Security 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.

Select from 2 files

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 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.

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