https://github.com/eyaltrabelsi/pandas-log
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
https://github.com/eyaltrabelsi/pandas-log
Last synced: 5 months ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/eyaltrabelsi/pandas-log
- Owner: eyaltrabelsi
- License: mit
- Created: 2019-09-18T17:58:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-26T10:28:45.000Z (over 4 years ago)
- Last Synced: 2024-03-21T22:04:29.811Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 2.09 MB
- Stars: 214
- Watchers: 7
- Forks: 12
- Open Issues: 10
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-data-analysis - Pandas-log - Logs pandas operations for data transformation tracking. (🐍 Python / Useful Python Tools for Data Analysis)
- awesome-data-analysis - Pandas-log - Logs pandas operations for data transformation tracking. (🐍 Python / Useful Python Tools for Data Analysis)
README
==========
pandas-log
==========.. image:: https://img.shields.io/pypi/v/pandas_log.svg
:target: https://pypi.python.org/pypi/pandas_log.. image:: https://img.shields.io/travis/eyaltrabelsi/pandas-log.svg
:target: https://travis-ci.org/eyaltrabelsi/pandas-log.. image:: https://readthedocs.org/projects/pandas-log/badge/?version=latest
:target: https://pandas-log.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status.. image:: https://pyup.io/repos/github/eyaltrabelsi/pandas-log/shield.svg
:target: https://pyup.io/repos/github/eyaltrabelsi/pandas-log/
:alt: UpdatesThe 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:
.. code-block:: python
import pandas
import pandas_logwith pandas_log.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:
.. code-block:: python
df.assign(toy=lambda x: x.toy.map(str.lower))
.query("name != 'Batman'")``pandas-log`` can be especially helpful in longer pipes:
.. code-block:: python
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:.. code-block:: bash
pip install pandas-log
Contributing
------------
Follow `contribution docs
`_ for a full description of the process of contributing to ``pandas-log``.