Methods for pandas DataFrame and Series.
Project description
pdpatch
New methods for pandas DataFrame and Series.
Install
pip install pdpatch
How to use
from pdpatch.core import *
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 |
Interactive Method .less()
df.less(2)
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)
df.less(2)
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.0.6.tar.gz
(7.8 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
File details
Details for the file pdpatch-0.0.6.tar.gz.
File metadata
- Download URL: pdpatch-0.0.6.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec48e71636e1df6fbabf831db458c941583e518601a7fc932c0aa5a8dd232386
|
|
| MD5 |
836a6bad086b34d486a59ca34e713c75
|
|
| BLAKE2b-256 |
0781f3268b16a84186175a8ccac7487f60d651d19f3f754b7f162a937e3c27bf
|
File details
Details for the file pdpatch-0.0.6-py3-none-any.whl.
File metadata
- Download URL: pdpatch-0.0.6-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bb7466d46aba0ab2268027c51d71ae441ea9b5fe0aa194b062da09643c88a69
|
|
| MD5 |
4ddfe8243511fd7278f3fa1ea2e9542d
|
|
| BLAKE2b-256 |
e5cdc4ac0dd460302184e5bfae6fa2199dfdda32e3dc582a0e5a0d426e734963
|