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 hashes)