Logging for pandas and more.
Project description
redquill
Logging for pandas and more.
Description
There are functions specifically to log pandas dataframes as well as functions to count up the total number of errors and warnings.
Dependencies
- pandas: Tested on 0.20.3 and higher. May work for earlier versions.
Example
For this example, import both the customlogger and pandas.
import redquill as rq
import pandas as pd
Initialize the logger. Note, the logger always logs to the console by default. You may inrqude a log directory and the log file name, which will allow the logs to flow into a file as well.
log = rq.redquill()
The following will log any null values found in df
.
df = pd.DataFrame({"A": [1, 2, None, 3],
"B": [4, 2, 2, 5]})
log.warn_null_values(df=df)
Console output.
2018-03-04 01:34:33,162 - 23512 - WARNING - test_redquill.test_warn_null_values -
A B
2 NaN 2
The following will log any duplicates found in column
B
of df
.
df = pd.DataFrame({"A": [1, 2, None, 3],
"B": [4, 2, 2, 5]})
log.warn_duplicate_values(df=df, subset="B", msg="Duplicates on B.")
Console output.
2018-03-04 02:29:41,419 - 31825 - WARNING - test_redquill.test_warn_duplicate_values - Duplicates on B.
A B
1 2.0 2
2 NaN 2
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
File details
Details for the file redquill-0.0.1.tar.gz
.
File metadata
- Download URL: redquill-0.0.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e60228696beffeb14b4a72ca9c7f2ca6a8d77bbf4c0115a8c2691ea31d68d92 |
|
MD5 | 4a254886b807a92a83b66e56496c5f45 |
|
BLAKE2b-256 | 1d416b5d04d92827f16f034d17cf98e072c0e1861d1a0e8fed4d1131080277ef |
File details
Details for the file redquill-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: redquill-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 817f3d982998543dc0d9226b6dd0d362a6b26f20c0459fd46a7b264c00727756 |
|
MD5 | ca1e30fcf69e82e82cea0c3fbb37792f |
|
BLAKE2b-256 | 5e1d875a949c747a0b5e9358913d7d6c72dfce33c8e8c8c3fe904e8b083bdea2 |