Skip to main content

Python package df2onehot is to convert a pandas dataframe into a stuctured dataframe.

Project description

df2onehot

Python PyPI Version License Downloads Downloads Coffee

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

  • Erdogan Taskesen, github: erdogant
  • Contributions are welcome.
  • If you wish to buy me a Coffee for this work, it is very appreciated :)

Project details


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.15.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

df2onehot-0.2.15-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file df2onehot-0.2.15.tar.gz.

File metadata

  • Download URL: df2onehot-0.2.15.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.8.5

File hashes

Hashes for df2onehot-0.2.15.tar.gz
Algorithm Hash digest
SHA256 3a6c86967f100abd8f1463778bcba7a9c193bb033bc455c86d356d22bd6ec77b
MD5 85bdf1c195657bd97b69b211426085cb
BLAKE2b-256 6c18ca1b1a490dd5825081a7cb85c38eb7187cd4381e0803d03f36d28045a6cd

See more details on using hashes here.

File details

Details for the file df2onehot-0.2.15-py3-none-any.whl.

File metadata

  • Download URL: df2onehot-0.2.15-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.8.5

File hashes

Hashes for df2onehot-0.2.15-py3-none-any.whl
Algorithm Hash digest
SHA256 f5e77e30a1d8b6ff84b2464b1dc4c65c096e7ecf1b68332b32400eaeb9559ce5
MD5 3004c6e209723dc99aa703557b5ccec8
BLAKE2b-256 27c2127990e59d5ed5eff09daefeabfa0bb661b71454ce2d1798697ea071771d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page