Methods for pandas DataFrame and Series.
Project description
pdpatch
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
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.renamec({'col_1': 'new_name'})
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
| 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
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
| 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.1.tar.gz
(12.0 kB
view details)
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
pdpatch-0.1.1-py3-none-any.whl
(11.0 kB
view details)
File details
Details for the file pdpatch-0.1.1.tar.gz.
File metadata
- Download URL: pdpatch-0.1.1.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
229a013ba740402c5e99986d4e05dc27d28d436e2df15f92f4baf63c759f4db5
|
|
| MD5 |
73ec65b9d1794a1caa370e13892bc0d8
|
|
| BLAKE2b-256 |
c510aea0d914432ed7524df6a4d6d926d2f4fb27500d061dbc9649e25a560cee
|
File details
Details for the file pdpatch-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pdpatch-0.1.1-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 |
d8b4cd69010bfa056fca984bb89d977ed4649abc13cae672d6b3ad998bc47380
|
|
| MD5 |
e005f2c4f94bcc9662a4e49cc2e7100f
|
|
| BLAKE2b-256 |
6327ce8755df8702e5e103d0e6f082070137bd86ba266b1ac1eb5049e6b0f1e0
|