Utilities for pandas.
import pdutil for subdf in pdutil.iter.sub_dfs_by_size(df, 2): print(subdf)
pip install pdutil
pdutil is divided into several sub-modules by functionality:
Functions related to displaying
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.
Functions related to iterating over
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.
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.
SerializationFormat- A mutli-singleton representing different serialization formats of dataframes.
Package author and current maintainer is Shay Palachy (email@example.com); You are more than welcome to approach him for help. Contributions are very welcomed.
git clone firstname.lastname@example.org:shaypal5/pdutil.git
Install in development mode:
cd pdutil pip install -e .
To run the tests use:
pip install pytest pytest-cov coverage cd pdutil pytest
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.
Created by Shay Palachy (email@example.com).