Skip to main content

Auxiliary functions to clean pandas data frames

Project description

Pywrangle

Library with auxiliary functions to clean pandas data frames. Available on PyPI here

Install

  • Python 3.6+
  • numpy
  • pandas

To install pywrangle, use pip:

pip install pywrangle

Import

Per convention with Python Analysis modules, import pywrangle as follows:

>>> import pywrangle as pw

Missing Data

print_nulls_per_col(df) -> None:

Calculates number of null values in each column and prints result.

String cleaning

def clean_str_columns(df: object, col_strcase_tuple: tuple) -> df:

Master function to clean string columns using col_strcase_tuple key.

TODO:

TODO lists available in pywrangle functions.

  1. Add testing documentation.
    1. Follow
  2. Missing data functions
    1. show correlation between NULL values in different columns. e.g., if state is missing, likely region is missing too
    2. barchart with number of NULL per num columns
      1. show number of rows with NULL in only 1 column, 2 columns, 3 columns etc.
      2. May like to include optional parameters to show correlation b/w NULL values in different columns?
    3. Print number of rows with NULL in X columns - optional param for desc sort by num NULL?
  3. Create pywrangle documentation website?

History

version = "0.2.40"

  • refactored code for clarity
  • added display info to print_df_changes

version = "0.2.1"

  • Created init file for function imports
  • Documentation on importing pywrangle
  • Added numpy as required package.
  • Changed package requirements to greater than or equal to.

version = "0.0.1"

  • Init

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

pywrangle-0.2.48.tar.gz (7.6 kB view details)

Uploaded Source

File details

Details for the file pywrangle-0.2.48.tar.gz.

File metadata

  • Download URL: pywrangle-0.2.48.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/49.5.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for pywrangle-0.2.48.tar.gz
Algorithm Hash digest
SHA256 4f4eb7d23601ac17b631ef60c22fa4f49d5b4c76e7868881f40765f24e0c9a18
MD5 9845810c79922c7bc319a35b207f35cc
BLAKE2b-256 fe3f0d7bba80ef1b211000e1e20dc0d15975bd576a03fe43f8597d6b36efb2a6

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