bitPhile

Home

❯

notes

❯

tech

❯

numpy

❯

masked arrays

masked-arrays

Sep 19, 20241 min read

  • data
  • libraries
  • python

Masked Arrays

Masked arrays are arrays with invalid or missing values. Numpy has numpy.ma module dedicated to masked arrays.

np.ma.array([1, 2, 3, 4], mask=[0, 1, 0, 1])
# masked_array(data=[1, --, 3, --],
#            mask=[False,  True, False,  True],
#      fill_value=999999)

References

  1. https://lectures.scientific-python.org/intro/numpy/elaborate_arrays.html#maskedarray-dealing-with-propagation-of-missing-data

Graph View

  • Masked Arrays
  • References

Created with Quartz v4.5.0 © 2025

  • GitHub
  • Discord Community