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.
- Add testing documentation.
- Missing data functions
- show correlation between NULL values in different columns. e.g., if state is missing, likely region is missing too
- barchart with number of NULL per num columns
- show number of rows with NULL in only 1 column, 2 columns, 3 columns etc.
- May like to include optional parameters to show correlation b/w NULL values in different columns?
- Print number of rows with NULL in X columns - optional param for desc sort by num NULL?
- Create wrapper that prints changes in the data frame size.
- Helpful when dropping is_na rows.
- Can create optional param to assert that dropped_rows = num_na before
- Create pywrangle documentation website?
History
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
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
pywrangle-0.2.36.tar.gz
(6.3 kB
view details)
File details
Details for the file pywrangle-0.2.36.tar.gz
.
File metadata
- Download URL: pywrangle-0.2.36.tar.gz
- Upload date:
- Size: 6.3 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8fa8eb62525777e2cc4b6fd7205eaa5890a26e5c99c751a62d414a65192d159 |
|
MD5 | 90d09206f519e6877932ae7f51f357d2 |
|
BLAKE2b-256 | 01e34d1847c4c11625f290b5e83bd9ab46d25393fa6c270f9294fe634df1c6f0 |