Skip to main content

mapply

build codecov pypi Version python downloads black

mapply provides sensible multi-core apply/map/applymap functions for Pandas.

mapply vs. pandarallel vs. swifter

Where pandarallel only requires dill (and therefore has to rely on in-house multiprocessing and progressbars), swifter relies on the heavy dask framework, converting to Dask DataFrames and back. In an attempt to find the golden mean, mapply is highly customizable and remains lightweight, leveraging the powerful pathos framework, which shadows Python's built-in multiprocessing module using dill for universal pickling.

Installation

This pure-Python, OS independent package is available on PyPI:

$ pip install mapply

Usage

readthedocs

For documentation, see mapply.readthedocs.io.

import pandas as pd
import mapply

mapply.init(
    n_workers=-1,
    chunk_size=100,
    max_chunks_per_worker=8,
    progressbar=False
)

df = pd.DataFrame({"a": list(range(100))})

# avoid unnecessary multiprocessing:
# due to chunk_size=100, this will act as regular apply.
# set chunk_size=1 to skip this check and let max_chunks_per_worker decide.
df["squared"] = df.mapply(lambda x: x ** 2)

Development

gitmoji pre-commit

Run make help for options like installing for development, linting, testing, and building docs.

Download files

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

Source Distribution

mapply-0.1.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mapply-0.1.2-py2.py3-none-any.whl (7.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mapply-0.1.2.tar.gz.

File metadata

  • Download URL: mapply-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for mapply-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dea993f7cff66587323f6653a8466ffa261d83044bd9226aec219d530f318128
MD5 067f15f6b37e884e3db4da9f2c42b917
BLAKE2b-256 7a5e2ba594c755cc547144f2280beb5b16ea8e300f708a4866657cef2e6b3d34

See more details on using hashes here.

File details

Details for the file mapply-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: mapply-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for mapply-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 46e1e3469975c3b6b2bd18ac0ed0ed59d2d321d269c47d4c2698321f6ccc7b0e
MD5 f35a72542b126bbe60a827114b432421
BLAKE2b-256 b5fd3227dd7bd11b73e4cbfbf82794f6200a060cc27eb31ced4997bd8c3f1af3

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.31

2 files

0.1.30

2 files

0.1.29

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

0.1.25

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page