Python package df2onehot is to convert a pandas dataframe into a stuctured dataframe.
Project description
df2onehot
Star it if you like it!
- df2onehot is Python package to convert your complex dataframe into a one-hot dense array.
Contents
Installation
- Install df2onehot from PyPI (recommended). df2onehot is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.
- It is distributed under the MIT license.
Quick Start
pip install df2onehot
- Alternatively, install df2onehot from the GitHub source:
git clone https://github.com/erdogant/df2onehot.git
cd df2onehot
python -U setup.py install
Import df2onehot package
import df2onehot
Example:
df = df2onehot.import_example()
# Convert
out = df2onehot.df2onehot(df)
# Force features (int or float) to be numeric if unique non-zero values are above percentage.
out = df2onehot.df2onehot(df, perc_min_num=0.8)
# Remove categorical features for which less then 2 values exists.
out = df2onehot.df2onehot(df, y_min=2)
# Combine two rules above.
out = df2onehot.df2onehot(df, y_min=2, perc_min_num=0.8)
Maintainers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
df2onehot-0.2.11.tar.gz
(33.4 kB
view details)
Built Distribution
File details
Details for the file df2onehot-0.2.11.tar.gz
.
File metadata
- Download URL: df2onehot-0.2.11.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22a160c70b3a0e21e57ada9ec84e6933c9400adb1b39df02751822e4b5eb084c |
|
MD5 | 40bebd99b4573f01eefbe340f8b1f502 |
|
BLAKE2b-256 | eabc73fe6e1b9b111f7c7fc6d2dd6fa6de0c67c3842840cd422d334bee80f155 |
File details
Details for the file df2onehot-0.2.11-py3-none-any.whl
.
File metadata
- Download URL: df2onehot-0.2.11-py3-none-any.whl
- Upload date:
- Size: 35.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb78feaaa835036e5a6f6e46eb61079e9a9327828f2ac5e2302574133851d3a6 |
|
MD5 | 8a5be4f5dc37647c3ae9ce3d924c2f5b |
|
BLAKE2b-256 | 980af08048b337775251b2e89b1a31477a2892f325bd1dd9c2fdc175f1417889 |