Skip to main content

Masked versions of array API compatible arrays

Project description

Logo. The MArray logo is a nod to NumPy's logo, but MArray is not affiliated with the NumPy project.

PyPI Downloads

MArray adds masks to your favorite Python Array API Standard compatible array library.

Install with pip:

pip install marray

or conda:

conda install -c conda-forge marray-python

Use the from...import...as syntax to get a masked array namespace.

# use with any Array API compatible library, installed separately
from marray import numpy as mxp
import numpy as xp  # optional (if the non-masked namespace is desired)

The resulting mxp namespace has all the features of xp that are specified in the Array API standard, but they are modified to be mask-aware. Typically, the signatures of functions in the mxp namespace match those in the standard; the one notable exception is the addition of a mask keyword argument of asarray.

mxp.asarray([1, 2, 3], mask=[False, True, False])
# MArray(array([1, 2, 3]), array([False,  True, False]))

In the spirit of the Zen of Python, this is the one and only obvious way to set the mask of an array.

Documentation provided by attributes of xp are exposed in the mxp namespace and are accessible via help. For more information, please see the tutorial.

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

marray-0.0.12.tar.gz (110.1 kB view details)

Uploaded Source

Built Distribution

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

marray-0.0.12-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file marray-0.0.12.tar.gz.

File metadata

  • Download URL: marray-0.0.12.tar.gz
  • Upload date:
  • Size: 110.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for marray-0.0.12.tar.gz
Algorithm Hash digest
SHA256 d9cb475b0dee78ecb0f56cf0e7003d2bdb7d060ae935454e833823767c08d2bc
MD5 6e0b25c5d443932b5f6dd31580b1c190
BLAKE2b-256 25b03b482320283b51e35ccbbd1a9d448b8a0882b974eca6204bd9027c582d7b

See more details on using hashes here.

File details

Details for the file marray-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: marray-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for marray-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 86e1bf6120e9eb39ab3c4b4dd9ae8283f8f92d5c2895c0fc0f56c6255c50ecb7
MD5 a61ebf46e0a89cb57920b5b64899c0ad
BLAKE2b-256 ac31ec95df1853307419b173c1063669e865124222337e89bcf8ef57c20c8594

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