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.4.tar.gz
(30.6 kB
view details)
Built Distribution
df2onehot-0.1.4-py3-none-any.whl
(32.4 kB
view details)
File details
Details for the file df2onehot-0.1.4.tar.gz
.
File metadata
- Download URL: df2onehot-0.1.4.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5912cad5398fd69443d819eab54a64acb0a5f47c024158ec59709fd3ae915fe2 |
|
MD5 | ee191eb190939c10ce1ad070dfcc0047 |
|
BLAKE2b-256 | 7cb59b309a29a63484f5024036cf57d86445a90fff6ed4c5638648fd918fc7b0 |
File details
Details for the file df2onehot-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: df2onehot-0.1.4-py3-none-any.whl
- Upload date:
- Size: 32.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fbeb0325d782f22802962ca29d322f7310dbb8d12a92168e6e09b8ac6bad95d |
|
MD5 | d9e248efb70735b21ad08cf74a853554 |
|
BLAKE2b-256 | e23c9d47312f262eea8b6dfb54e22ea802ff06480fa6126bf55d53f1c72dc6cd |