Wrapper for df, series and df[col].apply parallelized
Project description
pandas-parallel-apply
df.apply(fn)
, df[col].apply(fn)
and series.apply(fn)
wrappers with tqdm included
Installation
pip install pandas-parallel-apply
Examples
See examples/
for usage on some dummy dataframe and series.
Usage
1. Procedural
Apply on each row of a dataframe
df.apply(fn)
-> apply_on_df_parallel(df: pd.DataFrame, fn: Callable, n_cores: int, pbar: bool = True)
Apply on a column of a dataframe and return the Series
df[col].apply(fn, axis=1)
-> apply_on_df_col_parallel(df: pd.DataFrame, col_name: str, fn: Callable, n_cores: int, pbar: bool = True)
Apply on a series and return the modified Series
series.apply(fn)
-> `apply_on_seris_parallel(series: pd.Series, fn: Callable, n_cores: int, pbar: bool = True)
Switches for boolean parallel/non-parallel
apply_on_df/df_col/series_maybe_parallel(*, parallel: bool, n_cores: int, pbar: bool = True)
2. Object Oriented Programming
Apply on each row of a dataframe
df.apply(fn)
-> DataFrameParallel(df, n_cores: int, pbar: bool = True).apply(fn)
Apply on a column of a dataframe and return the Series
df[col].apply(fn, axis=1)
-> DataFrameParallel(df, n_cores: int, pbar: bool=True)[col].apply(fn, axis=1)
Apply on a series
series.apply(fn)
-> SeriesParallel(series, n_cores: int, pbar: bool=True).apply(fn)
That's all.
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 pandas-parallel-apply-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cad31502cc4a78d51b121562f02b7759d3ba15598146af3221bec4d0831cc41f |
|
MD5 | c71dd2b7f6584542ccfcef6078533218 |
|
BLAKE2b-256 | 331518ed44b383f64c9709108faf5a1891731b656433cdc6364a08b9af2392f2 |
Hashes for pandas_parallel_apply-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd253c24568e5b29fb1112d50daf592ebe2dcf8f8f2dcb72033b1c139638abbb |
|
MD5 | 49a78e23d5b6172623382c6dca4a6929 |
|
BLAKE2b-256 | 6c54e758e24ba917bc9cc6ff591fa982e8414de4f5bdd35e7dbd62fe5c765e60 |