Install & Compatibility
Where this runs
tested against v0.32.23 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 2.634s · 327.6MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 13.6s · import 2.641s · 315MB
328MB installed
● package 328MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
janitor
✓ import janitor
Imports pyjanitor's functionality, registering its methods as pandas DataFrame accessors/methods.
pandas
✓ import pandas as pd
pandas is a prerequisite for pyjanitor's functionality.
This quickstart demonstrates how to install pyjanitor, import it alongside pandas, and use the `clean_names()` function to standardize column headers in a DataFrame for easier manipulation. This function automatically converts names to lowercase and replaces spaces and special characters with underscores.
import pandas as pd
import janitor
# Sample DataFrame with messy column names
data = {
'First Name': ['Alice', 'Bob'],
'Last-Name': ['Smith', 'Johnson'],
'AGE (Years)': [24, 30]
}
df = pd.DataFrame(data)
print("Original DataFrame:\n", df)
# Clean column names using pyjanitor's clean_names()
cleaned_df = df.clean_names()
print("\nCleaned DataFrame:\n", cleaned_df)
print("\nCleaned column names:", cleaned_df.columns.tolist())
Debug
Known issues
deprecatedThe `mutate` DataFrame method has been deprecated. Users are advised to transition to alternative approaches for adding or modifying columns.fixUse `pd.DataFrame.assign` for general column additions/modifications. For groupby operations, utilize the `assign` method directly on the groupby object: `df.groupby('col').assign(...)` which was introduced in v0.32.18. affects: >=0.32.17
breakingDirect usage of 'by' methods for groupby operations on DataFrames has been migrated to be directly available on groupby objects for improved API consistency.fixEnsure that `groupby` operations access methods directly on the `DataFrameGroupBy` object returned by `.groupby()`. Review documentation examples for updated patterns.
affects: >=0.32.20
deprecatedFunctions like `add_column`, `add_columns`, `remove_columns`, `rename_column`, `rename_columns`, and `filter_on` are slated for deprecation in a future 1.x release, as their functionality largely overlaps with native pandas methods.fixPrefer native pandas functions such as `pd.DataFrame.assign`, `pd.DataFrame.drop`, `pd.DataFrame.rename`, and `pd.DataFrame.query` where possible.
affects: Future 1.x releases (warnings may appear in 0.x).
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyjanitor'
The pyjanitor package is not installed in the current Python environment or the environment in use is not the one where pyjanitor was installed.
fixEnsure pyjanitor is installed in your active environment: `pip install pyjanitor`. If using virtual environments, activate the correct environment before running your code.
AttributeError: 'DataFrame' object has no attribute 'clean_names'
The `janitor` module was not imported, which means its DataFrame accessor methods have not been registered with pandas.
fixAdd `import janitor` to your script after `import pandas as pd`. This registers pyjanitor's functions as DataFrame methods.
TypeError: 'DataFrameGroupBy' object has no attribute 'mutate' (or similar for other deprecated methods on groupby objects)
Attempting to use a deprecated pyjanitor method on a pandas GroupBy object, or before the relevant methods were added to GroupBy objects.
fixFor operations on grouped DataFrames, use `df.groupby(...).assign(...)` instead of `mutate`. Refer to pyjanitor's documentation for the correct methods available on GroupBy objects for your version.
Upgrade
Version history
0.32.23latest on PyPI · released Apr 7, 2026
Audit
Dependencies
pandasrequiredCore dependency; pyjanitor extends pandas DataFrames.