bundles / numpy 2.4.4 / numpy / ma / core / mask_or
function
numpy.ma.core:mask_or
source: /numpy/ma/core.py :1748
Signature
def mask_or ( m1 , m2 , copy = False , shrink = True ) Summary
Combine two masks with the logical_or operator.
Extended Summary
The result may be a view on m1 or m2 if the other is nomask (i.e. False).
Parameters
m1, m2: array_likeInput masks.
copy: bool, optionalIf copy is False and one of the inputs is
nomask, return a view of the other input mask. Defaults to False.shrink: bool, optionalWhether to shrink the output to
nomaskif all its values are False. Defaults to True.
Returns
mask: output maskThe result masks values that are masked in either
m1orm2.
Raises
: ValueErrorIf
m1andm2have different flexible dtypes.
Examples
import numpy as np m1 = np.ma.make_mask([0, 1, 1, 0]) m2 = np.ma.make_mask([1, 0, 0, 0]) np.ma.mask_or(m1, m2)
Aliases
-
numpy.ma.mask_or