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
and seaborn
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')
from pdpatch.seaborn import sns
sns.scatterplot(data=df, x='time__s__', y='position__m__');
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
pdpatch-0.1.4.tar.gz
(11.9 kB
view details)
Built Distribution
pdpatch-0.1.4-py3-none-any.whl
(10.8 kB
view details)
File details
Details for the file pdpatch-0.1.4.tar.gz
.
File metadata
- Download URL: pdpatch-0.1.4.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 719a74b10f25d6808d8f03471356888a93c2cf54f83df24ddc99390ea657ee7f |
|
MD5 | 352638193094759b257e123da0affc80 |
|
BLAKE2b-256 | d66a1137b89fcec4201bc6bb093a321a096b2dd0bc0f9367f2a869f2cb50d120 |
File details
Details for the file pdpatch-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: pdpatch-0.1.4-py3-none-any.whl
- Upload date:
- Size: 10.8 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 | 5d3a72d104a32fc9d8ffa9a8b3d6f2734f98dfcb2c28f363a441e01a67f930ef |
|
MD5 | 5d9670cb7a920da4d021b0e02063ccd1 |
|
BLAKE2b-256 | 53966a2981bb5e37646be235e661aaf7f3126087c8e9b229b59157f16f8310bf |