Skip to content
The goal of pandas-log is to provide feedback about basic pandas operations. It provides simple wrapper functions for the most common functions that add additional logs
Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
docs
examples mend Nov 3, 2019
pandas_log mend Nov 3, 2019
AUTHORS.rst - Oct 10, 2019
CONTRIBUTING.rst
HISTORY.rst - Oct 10, 2019
LICENSE - Oct 10, 2019
MANIFEST.in
Makefile Fix original methods not restored for old dataframes Oct 21, 2019
README.rst
TODO.rst
requirements_dev.txt
setup.cfg
setup.py mend Nov 3, 2019
tox.ini

README.rst

pandas-log

Documentation Status Updates

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 medium article go here

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.

You can’t perform that action at this time.