pandas-log provides feedback about basic pandas operations. It provides simple wrapper functions for the most common functions, such as apply, map, query and more.
Project description
The goal of pandas-log is to provide feedback about basic pandas operations. It provides simple wrapper functions for the most common functions, such as .query, .apply, .merge, .group_by and more.
Why pandas-log?
Pandas-log is a Python implementation of the R package tidylog, and provides a feedback about basic pandas operations.
The pandas has been invaluable for the data science ecosystem and 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 and if the result is unexpected it’s hard to understand what happened. Pandas-log log metadata on each operation which will allow to pinpoint the issues.
Lets look at an example, first we need to load pandas-log after pandas and create a dataframe:
import pandas
import pandas_logs
with pandas_logs.enable():
df = pd.DataFrame({"name": ['Alfred', 'Batman', 'Catwoman'],
"toy": [np.nan, 'Batmobile', 'Bullwhip'],
"born": [pd.NaT, pd.Timestamp("1940-04-25"), pd.NaT]})
pandas-log will give you feedback, for instance when filtering a data frame or adding a new variable:
df.assign(toy=lambda x: x.toy.map(str.lower))
.query("name != 'Batman'")
pandas-log can be especially helpful in longer pipes:
df.assign(toy=lambda x: x.toy.map(str.lower))
.query("name != 'Batman'")
.dropna()\
.assign(lower_name=lambda x: x.name.map(str.lower))
.reset_index()
For a full walkthrough go here
Installation
pandas-log is currently installable from PyPI:
pip install pandas-log
Contributing
Follow contribution docs for a full description of the process of contributing to pandas-log.
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
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 pandas-log-0.1.2.tar.gz.
File metadata
- Download URL: pandas-log-0.1.2.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff5b5d68070facec8e7576fa304943ceb0b82c4f0e56097c5b4636bf2ab50738
|
|
| MD5 |
97e946e5b0a729c74fb59a8624fb5c71
|
|
| BLAKE2b-256 |
a96de0b13569a124b6e1c190ff89cd2163fb2cf1757ada257278131985cc0a0e
|
File details
Details for the file pandas_log-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: pandas_log-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6208a28a0f3797ec28536cf3b47dbad63a364bf86ec2300854be6c767f77e67
|
|
| MD5 |
01b1b310f0e49377ff595e130d45ee99
|
|
| BLAKE2b-256 |
1449d0799dbf7c23d14a07884ca0dc95677c61e52cd4314d983b98e82a10953f
|