Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Sklearn transformers that work with Pandas dataframes

Project description


A little module with a few transformers to work with Pandas dataframes in the
Sklearn pipeline. Example usage:

.. code:: python
pipeline = Pipeline([
('ordinal_to_nums', DFTransform(_ordinal_to_nums, copy=True)),
('union', DFFeatureUnion([
('categorical', Pipeline([
('select', DFTransform(lambda X: X.select_dtypes(include=['object']))),
('fill_na', DFTransform(lambda X: X.fillna('NA'))),
('one_hot', DFTransform(_one_hot_encode)),
('numerical', Pipeline([
('select', DFTransform(lambda X: X.select_dtypes(exclude=['object']))),
('fill_median', DFTransform(lambda X: X.fillna(X.median()))),
('add_features', DFTransform(_add_features, copy=True)),
('remove_skew', DFTransform(_remove_skew, copy=True)),
('find_outliers', DFTransform(_find_outliers, copy=True)),
('normalize', DFTransform(lambda X: X.div(X.max())))

For more information read `this blog post <>`_.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pdtransform, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size pdtransform-0.1-py2.py3-none-any.whl (3.6 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size pdtransform-0.1.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page