Skip to main content

Wrapper for df 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandas-parallel-apply-1.4.2.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file pandas-parallel-apply-1.4.2.tar.gz.

File metadata

  • Download URL: pandas-parallel-apply-1.4.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for pandas-parallel-apply-1.4.2.tar.gz
Algorithm Hash digest
SHA256 68734623fec5295951676506c10bd4e3caf577344c306ac39410873519254e49
MD5 9f4c2d045a7eacfffa8784d590c398d7
BLAKE2b-256 823075db60ee535067a1b19d405348696c87c354597b33d632b3e02a9412462b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page