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.7.tar.gz (96.4 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.7-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for marray-0.0.7.tar.gz
Algorithm Hash digest
SHA256 32b0fc83995ad4dfdd164d2f578209b77fa25ad28ea13b46f1786260f220b036
MD5 7d7bcfe47699cbfb55f1f1a0c9490bf3
BLAKE2b-256 aef9ad0cc547f10997f479d5de47e27485a8a94e81af0ab5c5db04f3e6d9f9b7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for marray-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2694d4488c417ee9394aa9f4ef3a45f738c006b006d4bc036c856a5248322402
MD5 d783e890a0224c7d7c16cf98997e1d2f
BLAKE2b-256 1f50e77fc0e0edb52d4f1745a275c370e53c5a02d1c7d136a65add99a40ef7c1

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