Installation:
$ pip install pdtransform
A little package with a few transformers to work with Pandas dataframes in the Sklearn pipeline, which I found myself writing quite frequently. Example usage:
from pdtransform import DFTransform, DFFeatureUnion
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.
Metadata
Release files for pdtransform 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pdtransform-0.2.tar.gz | 2.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pdtransform-0.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 6.1 kB
Release files / pdtransform-0.2.tar.gz
| Download URL | pdtransform-0.2.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ae101f7bfdaead85269b1dec5fd796f054bec491910a6d0430504645c44c628
|
|
BLAKE2b-256 checksum How to use checksums |
4e6ccf8b761f13811f6ba52ff41cd74730a1219c26c7b44130db5770c23cd5f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pdtransform-0.2-py2.py3-none-any.whl
| Download URL | pdtransform-0.2-py2.py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
88359e9649cc7d530b209731b97c3120d2d303f3f122e1593e94bdbe5468dfdc
|
|
BLAKE2b-256 checksum How to use checksums |
763787df6568d24234b9d258d7a93bd549b01ef7572987dfa50a44c1c7466575
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |