Skip to main content

Tools for cleaning pandas DataFrames

Project description

pyjanitor is a Python implementation of the R package janitor, and provides a clean API for cleaning data.

Why janitor?

Originally a port of the R package, pyjanitor has evolved from a set of convenient data cleaning routines into an experiment with the method chaining paradigm.

Data preprocessing usually consists of a series of steps that involve transforming raw data into an understandable/usable format. These series of steps need to be run in a certain sequence to achieve success. We take a base data file as the starting point, and perform actions on it, such as removing null/empty rows, replacing them with other values, adding/renaming/removing columns of data, filtering rows and others. More formally, these steps along with their relationships and dependencies are commonly referred to as a Directed Acyclic Graph (DAG).

The pandas API has been invaluable for the Python data science ecosystem, and implements method chaining of a subset of methods as part of the API. For example, resetting indexes (.reset_index()), dropping null values (.dropna()), and more, are accomplished via the appropriate pd.DataFrame method calls.

Inspired by the ease-of-use and expressiveness of the dplyr package of the R statistical language ecosystem, we have evolved pyjanitor into a language for expressing the data processing DAG for pandas users.

Functionality

Current functionality includes:

  • Cleaning columns name (multi-indexes are possible!)

  • Removing empty rows and columns

  • Identifying duplicate entries

  • Encoding columns as categorical

  • Splitting your data into features and targets (for machine learning)

  • Adding, removing, and renaming columns

  • Coalesce multiple columns into a single column

  • Date conversions (from matlab, excel, unix) to Python datetime format

  • Expand a single column that has delimited, categorical values into dummy-encoded variables

  • Concatenating and deconcatenating columns, based on a delimiter

  • Syntactic sugar for filtering the dataframe based on queries on a column

  • Experimental submodules for finance, biology, chemistry, and engineering

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

pyjanitor-0.18.1.tar.gz (51.9 kB view details)

Uploaded Source

Built Distribution

pyjanitor-0.18.1-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file pyjanitor-0.18.1.tar.gz.

File metadata

  • Download URL: pyjanitor-0.18.1.tar.gz
  • Upload date:
  • Size: 51.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for pyjanitor-0.18.1.tar.gz
Algorithm Hash digest
SHA256 aa087dfb378c875e44b589d3e31c3a29ae1d8804d0d27cd20363242985db847d
MD5 c745a48f5975cc9888241f8bfc321a11
BLAKE2b-256 9368aa9e83634887f995d9e9e436bda908b4a4c545b35c96ae41e76f5e395908

See more details on using hashes here.

File details

Details for the file pyjanitor-0.18.1-py3-none-any.whl.

File metadata

  • Download URL: pyjanitor-0.18.1-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for pyjanitor-0.18.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b45f875929029545e33bcbee00a96e880a65092080577db90c2c2657ba403cf5
MD5 9395ee76f6ae883148a91a4e445e755a
BLAKE2b-256 e9e508b1fc9673252589d6b8e7153c8a588bfeb516bb35c6b69a0500ee639116

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