skillfed

sklearn-pandas

Pandas integration with sklearn

sklearn-pandas v2.2.0 205.9K downloads/30d#9,580 on PyPI2,844
Permissive license MIT License Abandoned released

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

uv

uv add sklearn-pandas

poetry

poetry add sklearn-pandas

Installing 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

pandas dataframe to sklearn transformermap dataframe columns to sklearnfeature engineering pandas sklearndataframe mapper machine learningsklearn pandas integrationtransform dataframe columns sklearnpandas feature extraction sklearn
pandas-sklearn-bridgefeature-engineeringabandoned

More Artificial Intelligence packages