Utilities for pandas.
Project description
Utilities for pandas.
import pdutil
for subdf in pdutil.iter.sub_dfs_by_size(df, 2):
print(subdf)
1 Installation
pip install pdutil
2 Basic Use
pdutil is divided into several sub-modules by functionality:
2.1 display
Functions related to displaying pandas DataFrames:
df_string - Returns a nicely formatted string for the given dataframe.
pandas_big_frame_setup - Sets pandas to display really big data frames.
df_to_html - Return a nicely formatted HTML code string for the given dataframe.
2.2 iter
Functions related to iterating over pandas dataframes:
sub_dfs_by_size - Get a generator yielding consecutive sub-dataframes of the given size.
sub_dfs_by_num - Get a generator yielding num consecutive sub-dataframes of the given df.
2.3 transform
x_y_by_col_lbl - Returns an X dataframe and a y series by the given column name.
or_by_masks - Returns a sub-dataframe by the logical or over the given masks.
2.4 serial
SerializationFormat - A mutli-singleton representing different serialization formats of dataframes.
3 Contributing
Package author and current maintainer is Shay Palachy (shay.palachy@gmail.com); You are more than welcome to approach him for help. Contributions are very welcomed.
3.1 Installing for development
Clone:
git clone git@github.com:shaypal5/pdutil.git
Install in development mode:
cd pdutil
pip install -e .
3.2 Running the tests
To run the tests use:
pip install pytest pytest-cov coverage
cd pdutil
pytest
3.3 Adding documentation
The project is documented using the numpy docstring conventions, which were chosen as they are perhaps the most widely-spread conventions that are both supported by common tools such as Sphinx and result in human-readable docstrings. When documenting code you add to this project, follow these conventions.
4 Credits
Created by Shay Palachy (shay.palachy@gmail.com).
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
Hashes for pdutil-0.0.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dea162aab2092eb43bad7e187bbe0f563efc22ed8b47f08dab3356c6eb48a90 |
|
MD5 | 08c05d347c00aa7bf463783eb55b80a2 |
|
BLAKE2b-256 | 23200e9bb76c24b2d4a4a7a22d106a9f0d992e1436b5585099e405a7082f9f3f |