Skip to main content
Ctrl+K
NumPy v1.26 Manual - Home
  • User Guide
  • API reference
  • Development
  • Release notes
  • Learn
  • GitHub
  • Twitter
  • User Guide
  • API reference
  • Development
  • Release notes
  • Learn
  • GitHub
  • Twitter

Section Navigation

  • Array objects
    • The N-dimensional array (ndarray)
    • Scalars
    • Data type objects (dtype)
    • Indexing routines
    • Iterating over arrays
    • Standard array subclasses
    • Masked arrays
      • The numpy.ma module
      • Constants of the numpy.ma module
      • Masked array operations
    • The array interface protocol
    • Datetimes and Timedeltas
  • Array API Standard Compatibility
  • Constants
  • Universal functions (ufunc)
  • Routines
  • Typing (numpy.typing)
  • Global state
  • NumPy C-API
  • CPU/SIMD Optimizations
  • NumPy security
  • NumPy and SWIG
  • NumPy reference
  • Array objects
  • Masked arrays

Masked arrays#

Masked arrays are arrays that may have missing or invalid entries. The numpy.ma module provides a nearly work-alike replacement for numpy that supports data arrays with masks.

  • The numpy.ma module
    • Rationale
    • What is a masked array?
    • The numpy.ma module
  • Using numpy.ma
    • Constructing masked arrays
    • Accessing the data
    • Accessing the mask
    • Accessing only the valid entries
    • Modifying the mask
    • Indexing and slicing
    • Operations on masked arrays
  • Examples
    • Data with a given value representing missing data
    • Filling in the missing data
    • Numerical operations
    • Ignoring extreme values
  • Constants of the numpy.ma module
    • masked
    • nomask
    • masked_print_option
  • The MaskedArray class
    • MaskedArray
    • Attributes and properties of masked arrays
  • MaskedArray methods
    • Conversion
    • Shape manipulation
    • Item selection and manipulation
    • Pickling and copy
    • Calculations
    • Arithmetic and comparison operations
    • Representation
    • Special methods
    • Specific methods
  • Masked array operations
    • Constants
    • Creation
    • Inspecting the array
    • Manipulating a MaskedArray
    • Operations on masks
    • Conversion operations
    • Masked arrays arithmetic

previous

numpy.broadcast.reset

next

The numpy.ma module

© Copyright 2008-2024, NumPy Developers.

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.15.4.