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.1.5.tar.gz
(30.7 kB
view details)
Built Distribution
df2onehot-0.1.5-py3-none-any.whl
(32.5 kB
view details)
File details
Details for the file df2onehot-0.1.5.tar.gz
.
File metadata
- Download URL: df2onehot-0.1.5.tar.gz
- Upload date:
- Size: 30.7 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 | 5f263b5c1d4a45966ba2fb42ea85f2712763540f11bdefb027aefc5c0d8c80d8 |
|
MD5 | 3e29d7871598d21d57be448434e71dd4 |
|
BLAKE2b-256 | 9b37b4869bef9c34bdf096761d0f2e1da86384800c863f8f58fd3f2a0e0ede0b |
File details
Details for the file df2onehot-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: df2onehot-0.1.5-py3-none-any.whl
- Upload date:
- Size: 32.5 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 | c3baa042cf4100bcb11ac778f460222c08c77a9b03985de9d93efe3138e2ca20 |
|
MD5 | 76924a55b085caf6b673dbaeea3db2f8 |
|
BLAKE2b-256 | 2d85f044279dd8118079a7343f0ca7fa8d2e42a64f3ac1fe9a4909695288d063 |