sklearn-pandas
Pandas integration with sklearn
What it is and what it does
sklearn-pandas provides a DataFrameMapper class that acts as a bridge between pandas DataFrames and scikit-learn's transformers. Instead of manually extracting columns, applying transformations, and reassembling arrays, you define a list of (column_selector, transformer, options) tuples, and the mapper handles the plumbing—selecting columns from your DataFrame, passing them through sklearn transformers, and combining the results back into a feature matrix.
The mapper supports flexible column selection (single columns, multiple columns, or callable selectors), custom naming of output features via aliases, prefixes, and suffixes, and automatic tracking of transformed feature names. It integrates directly into sklearn pipelines and works with both fit and transform operations. The four runtime dependencies—scikit-learn, scipy, pandas, and numpy—are standard in the ML stack, so installation is straightforward.
Use it for:
- Preprocessing mixed-type DataFrames by applying different transformers to different columns before feeding them to a classifier
- Building reproducible feature engineering pipelines that map raw DataFrame columns through standardization and encoding in a single object
- Tracking which original DataFrame columns produced which transformed features for model interpretability and debugging
- Dynamically selecting columns at fit time using callables to handle datasets with unknown or variable column sets
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Bridges pandas DataFrames and scikit-learn by mapping DataFrame columns to transformations and recombining them into features for machine learning pipelines.
No. The project is abandoned (last release 2021-05-08, last commit 2023-06-08) with no active maintenance. While the MIT License is permissive and install friction is low, the lack of updates means it may break with newer versions of scikit-learn, pandas, or numpy. For new projects, consider actively maintained alternatives.
Install
sklearn-pandas on PyPI
pip
pip install sklearn-pandasuv
uv add sklearn-pandaspoetry
poetry add sklearn-pandasInstalling sklearn-pandas
Before you install
Low install friction with a pure-Python wheel. However, the project is abandoned—last release was 2021-05-08 and last commit 2023-06-08. No active maintenance means bug fixes or compatibility updates are unlikely.
License in practice
MIT License permits commercial and private use with minimal restrictions, making it legally safe to adopt for most projects.
Quickstart
pip install sklearn-pandas
from sklearn_pandas import DataFrameMapper
import pandas as pd
import sklearn.preprocessing
data = pd.DataFrame({'pet': ['cat', 'dog'], 'children': [4., 6]})
mapper = DataFrameMapper([
('pet', sklearn.preprocessing.LabelBinarizer()),
(['children'], sklearn.preprocessing.StandardScaler())
])
mapper.fit_transform(data)
Verify before relying
- Compatibility with current versions of scikit-learn, pandas, numpy, and scipy—last release predates many recent major versions
- Whether the package works with modern Python versions (requires_python field is empty in metadata)
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — scikit-learn, scipy, pandas, numpy |
| Maintenance | abandoned — 1,924 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 205,933/month — #9,580 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sklearn_pandas-2.2.0-py2.py3-none-any.whl
Keywords: scikit, sklearn, pandas
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
sklearndfWraps scikit-learn estimators to return pandas…
permissive · top 15,000 on PyPI
datasieveDataSieve extends scikit-learn's Pipeline to…
permissive · top 15,000 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
skrubskrub prepares and transforms dataframes for…
permissive · top 15,000 on PyPI
woodworkWoodwork adds a typing layer to pandas…
permissive · top 15,000 on PyPI
featuretoolsFeaturetools automates feature engineering for…
permissive · top 15,000 on PyPI
gspread-pandasBridges Google Sheets and pandas DataFrames,…
permissive · top 15,000 on PyPI
pandavroReads and writes Apache Avro files to and from…
permissive · top 15,000 on PyPI
gspread-dataframeConverts between Google Sheets worksheets and…
permissive · top 5,000 on PyPI
pandas-read-xmlConverts XML files into pandas DataFrames, with…
permissive · top 15,000 on PyPI