Data Quality Check Library
Project description
DATA QUALITY
A library which acts as a test cases for dataframes. Simply pass in your dataframe after initial import, or at each stage of your EDA to check for data quality with one line of code.
The test cases include(as of now)
- check for null values
- check for duplicates
- check for dtype matching
- check for outliers
- check for whitespaces in column headers
The test cases work as a Pass/Fail type, where Passed indicates, good data quality and Failed indicates bad data quality
Example:
TEST CASE FOR NULL VALUES: Passed means that the dataframe has no null values. Failed indicates otherwise.
Requirements
- Python 3+
- Pandas
- Numpy
Installation
pip install data-quality-tests
Updates & Changes
- the import function changed from:
from data_quality import DataQuality
to the following:
from data_quality_tests import DataQuality
-
new function
outlier_columnshas been added in this update, which displays all the columns that have outliers.
For use case, refer to the get started section -
data_quality_checknow checks for column header whitespaces for leading and trailing. -
new function
dtype_columnshas been added in this update, which displays all the columns that failed data type matching. For use case, refer the get started section
Get Started
How to use this library:
Data quality check
The most basic usage of this library, here for simplifiction,
let's just se the iris dataset from seaborn library.
You can use any dataset.
from data_quality_tests import DataQuality as dq
import seaborn as sns
#declare any dataframe
df = sns.load_dataset("iris")
#pass the dataframe as below
dq.data_quality_check(df)
Outlier columns
Sometimes, the test case for outliers fails, this is because the dataset containes outliers.
use outier_columns(df) function to display all the columns that have outliers.
NOTE If the dataset does not have outlier columns, the output is an empty list.
# display columns that have outliers
dq.outlier_columns(df)
Data type columns
When it is observed the test for dtype matching has failed, this is due to an error in the data type. For example, sometimes numbers are in the form of strings.
use dtype_columns(df) function to display all the columns that failed data type matching.
#display list of columns that failed dtype matching
dq.dtype_columns(df)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file data-quality-tests-1.0.tar.gz.
File metadata
- Download URL: data-quality-tests-1.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7248b244069ab0ef906cc6c3796c0a2bd9a54318d46dda2d23f626f581dc21fa
|
|
| MD5 |
21970552aa221d711a9028bc18a83b98
|
|
| BLAKE2b-256 |
cbdd25336ebf49a183ce3284b33e560a66e2cb87747e408e29b1ed821e92b2f2
|
File details
Details for the file data_quality_tests-1.0-py3-none-any.whl.
File metadata
- Download URL: data_quality_tests-1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
335ca513fccbd15bfd73d2018938f748714c9a880043d362ee7a652628a8b003
|
|
| MD5 |
55dbdd3a28707c8e88afb43e5448250e
|
|
| BLAKE2b-256 |
2fbb83319370522c84c7feeade28480de406717b6700f929f53609b3224026fe
|