Skip to main content

Pandas Checks

PyPI - Python Version

Banner image for Pandas Checks

Pandas Checks adds .check methods to Pandas so you can inspect method chains without cutting them up.

As Fleetwood Mac says, you would never break the chain.

import pandas_checks

iris_processed = (
    iris
    .dropna()
    .check.assert_positive(subset=["petal_length", "sepal_length"]) # 🐼🩺 Validate assumptions
    .check.hist('petal_length') # 🐼🩺 Plot the distribution of a column after cleaning

    .query("species=='setosa'")
    .check.head(3)  # 🐼🩺 Display the first few rows after more cleaning
    .check.write("iris_processed.parquet") # 🐼🩺 Export the interim data, with type inferred from name
)
Sample output

The .check methods didn't modify how iris data got processed. That's the difference between .head() and .check.head().

Table of Contents

💡 See the docs for details and configuration options.

Installation

# With uv
uv add pandas-checks

# Or with pip
pip install pandas-checks

.check methods

Here's what's in the doctor's bag.

Assertions

General:

  • .check.assert_data() - Check that data passes an arbitrary condition, expressed as a lambda function - DataFrame | Series

Type assertions:

Value assertions:

Describe data

Disable Pandas Checks

These methods can disable Pandas Checks methods, temporarily or permanently.

  • .check.disable_checks() - Don't run checks. By default, still runs assertions. - DataFrame | Series
  • .check.enable_checks() - Run checks again. - DataFrame | Series

Export interim files

  • .check.write() - Export the current data, inferring file format from the name - DataFrame | Series

Time your code

  • .check.print_time_elapsed(start_time) - Print the execution time since you called start_time = pdc.start_timer() - DataFrame | Series

💡 Tip: You can use this stopwatch anywhere in your Python code.

from pandas_checks import print_elapsed_time, start_timer

start_time = start_timer()
...
print_elapsed_time(start_time)

Visualize data

Giving feedback and contributing

If you run into trouble or have questions, I'd love to know. Please open an issue.

Contributions are appreciated! Please see more details.

License

Pandas Checks is licensed under the BSD-3 License.

🐼🩺

Metadata

Release files for pandas-checks 2.1.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 pandas-checks 2.1.1
File Size Uploaded Provenance Actions
pandas_checks-2.1.1.tar.gz 33.1 kB Without provenance Details for pandas_checks-2.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pandas-checks 2.1.1
File Interpreter ABI Platform Actions
pandas_checks-2.1.1-py3-none-any.whl Python 3 none any Details for pandas_checks-2.1.1-py3-none-any.whl

Total release size: 68.1 kB

Release files / pandas_checks-2.1.1.tar.gz

Download URL pandas_checks-2.1.1.tar.gz
Size 33.1 kB
Tags Source
SHA-256 checksum
How to use checksums
585e72733829beb585a3ffb0be337f5b220ac16a2897c8ae41c7f504e4fdd70b
BLAKE2b-256 checksum
How to use checksums
ea7719945ee53b812062abadb025d228c0e6ffdadb7e54be2e61001555a179d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pandas_checks-2.1.1-py3-none-any.whl

Download URL pandas_checks-2.1.1-py3-none-any.whl
Size 35.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3302910e0eeb30ae18e0a3c3fecf7c411782c7fdf1118ab9e2613eaf674b36d
BLAKE2b-256 checksum
How to use checksums
87764b34612327e74f7171ae8e6bc4094f497327ba63663a65318429df2441ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pandas-checks 2.1.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.

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.

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