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 dataset
df = df2onehot.import_example()
Example:
from df2onehot import df2onehot
# Convert
out = df2onehot(df)
# Force features (int or float) to be numeric if unique non-zero values are above percentage.
out = df2onehot(df, perc_min_num=0.8)
# Remove categorical features for which less then 2 values exists.
out = df2onehot(df, y_min=2)
# Combine two rules above.
out = 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-1.0.0.tar.gz
(12.8 kB
view hashes)
Built Distribution
df2onehot-1.0.0-py3-none-any.whl
(13.4 kB
view hashes)
Close
Hashes for df2onehot-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 495fe5e07cbfed7c2a0902b72e15d7065103a6a3cabcaee9b644c1b8a24168ed |
|
MD5 | 4291c49e9d4a7e6b53e76ef8faf3cf0d |
|
BLAKE2b-256 | 87b021b775658ce9dc91f4fb3edb64a25143cbb955c2872d65df6b7ca1ddf054 |