pyjanitor
Tools for cleaning pandas DataFrames
What it is and what it does
pyjanitor is a pandas extension that adds a collection of data-cleaning methods designed to work as part of method chains. Instead of writing imperative pandas code with intermediate variable assignments, you can express a sequence of cleaning steps as a readable chain of method calls—each with an explicit verb name like clean_names(), remove_empty(), or rename_column(). The package is inspired by the R janitor package and the dplyr paradigm, bringing that fluent, declarative style to Python.
Under the hood, pyjanitor registers its functions as pandas DataFrame methods via pandas-flavor and depends on scipy, natsort, multipledispatch, and janitor-rs for its operations. It handles common preprocessing tasks: standardizing column names, removing null or empty rows and columns, identifying duplicates, encoding categorical data, splitting features and targets, coalescing columns, date conversions, and expanding delimited values into dummy variables. The package is actively maintained, supports Python 3.8 and later, and carries no known security vulnerabilities.
Use it for:
- Clean messy column names (spaces, mixed case, special characters) in a single method call before analysis.
- Chain multiple DataFrame transformations (drop nulls, rename columns, add computed fields) in a single readable expression.
- Preprocess raw data exports (Excel, CSV) by removing empty rows and columns and standardizing formats in one pipeline.
- Prepare machine learning datasets by splitting features and targets and encoding categorical variables declaratively.
- Expand delimited or categorical columns into dummy-encoded variables for statistical modeling.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extends pandas DataFrames with method-chainable data-cleaning functions, enabling readable, verb-based operations for common preprocessing tasks like column renaming, null removal, and data transformation.
Yes. pyjanitor solves a real readability and usability gap in pandas workflows. Low install friction, active maintenance, permissive MIT license, no known vulnerabilities, and strong adoption make it a safe, practical choice for teams that value readable data-cleaning code. Install it if you work with pandas and want method chains to replace imperative preprocessing logic.
Install
pyjanitor on PyPI
pip
pip install pyjanitoruv
uv add pyjanitorpoetry
poetry add pyjanitorInstalling pyjanitor
Before you install
Low friction install with five runtime dependencies. Actively maintained—last commit 2026-08-11, 1500 repository stars. Supports Python 3.8 and later.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
import pandas as pd
import janitor
df = pd.DataFrame({'Name': ['Alice', 'Bob'], 'Age': [None]})
df = df.clean_names().remove_empty()
Requires Python 3.8 or later; janitor-rs (a Rust-based dependency) must compile on your platform.
Verify before relying
- Performance characteristics when chaining many operations on large DataFrames.
- Compatibility of janitor-rs compilation on all target platforms (Windows, macOS, Linux variants).
- Extent of experimental submodules (finance, biology, chemistry, engineering, pyspark) and their stability.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — natsort, pandas-flavor, multipledispatch, scipy, janitor-rs |
| Maintenance | actively maintained — 129 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 383,172/month — #7,079 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyjanitor-0.32.23-py3-none-any.whl
Keywords: pandas, data-cleaning, data-science, janitor
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
pandas-flavorRegisters custom methods and accessors on…
permissive · top 5,000 on PyPI
skrubskrub prepares and transforms dataframes for…
permissive · top 15,000 on PyPI
gspread-pandasBridges Google Sheets and pandas DataFrames,…
permissive · top 15,000 on PyPI
gspread-dataframeConverts between Google Sheets worksheets and…
permissive · top 5,000 on PyPI
awkward-pandasExtends pandas DataFrames to store and…
permissive · top 15,000 on PyPI
pygwalkerTurns pandas DataFrames into interactive…
permissive · top 15,000 on PyPI
swifterSwifter applies functions to DataFrames and…
unclear · top 5,000 on PyPI
banalProvides type-checking and data-cleaning…
permissive · top 15,000 on PyPI
pandas-read-xmlConverts XML files into pandas DataFrames, with…
permissive · top 15,000 on PyPI