New methods for pandas DataFrame and Series.
Project description
pdpatch
pdpatch adds methods to pandas’ DataFrame and Series for a faster
data science pipeline. It also defines drop-in replacements for
seaborn and plotly.express that automatically label axes with nicer
titles.
Install
pip install pdpatch
How to use
from pdpatch.all import *
Interactive Method .less()
Automatically Rename snake_case columns in plotly.express
import pandas as pd
from pdpatch.express import *
df = pd.DataFrame({'time__s__': range(10), 'position__m__': range(10)})
px.scatter(df, x='time__s__', y='position__m__').show('png')
Shorter methods
df.rename(columns={'col_1': 'new_name'})->df.renamec({'col_1': 'new_name'})
df = dummydf()
df.renamec({'col_1': 'new_name'}).to_html()
| new_name | col_2 | |
|---|---|---|
| 0 | 100 | a |
| 1 | 101 | b |
| 2 | 102 | c |
| 3 | 103 | d |
| 4 | 104 | e |
Functions as methods
df.len()
5
New methods
df.col_1.minmax
(100, 104)
Utility functions
df = dummydf()
df.to_html()
| col_1 | col_2 | |
|---|---|---|
| 0 | 100 | a |
| 1 | 101 | b |
| 2 | 102 | c |
| 3 | 103 | d |
| 4 | 104 | e |
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 pdpatch-0.1.3.tar.gz.
File metadata
- Download URL: pdpatch-0.1.3.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8976f227ddc3667ac342540d7a9df6ee52cce7696c600c67405a6dedb984fe40
|
|
| MD5 |
31ec8f6ed2786357ec0dbbb5afe6bd6e
|
|
| BLAKE2b-256 |
4017b189490264b12ce5eb0fcbc0a4bdeefaac1342721d9e8dcb002b612d5d5e
|
File details
Details for the file pdpatch-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pdpatch-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8241a35c9ea480310ab11202452d741a4f4eb160fedd67311bb8a3f2afad1ae7
|
|
| MD5 |
1bd29e6503a30c2b907c03047c1c634d
|
|
| BLAKE2b-256 |
8be4736a492b3a6089cdd6344dbd9739999947f78e37be06927fc55a80bf6e4d
|