Mask whole 1-d vectors of an array that contain masked values.
(a, axis)
| 7823 | |
| 7824 | |
| 7825 | def _mask_propagate(a, axis): |
| 7826 | """ |
| 7827 | Mask whole 1-d vectors of an array that contain masked values. |
| 7828 | """ |
| 7829 | a = array(a, subok=False) |
| 7830 | m = getmask(a) |
| 7831 | if m is nomask or not m.any() or axis is None: |
| 7832 | return a |
| 7833 | a._mask = a._mask.copy() |
| 7834 | axes = normalize_axis_tuple(axis, a.ndim) |
| 7835 | for ax in axes: |
| 7836 | a._mask |= m.any(axis=ax, keepdims=True) |
| 7837 | return a |
| 7838 | |
| 7839 | |
| 7840 | # Include masked dot here to avoid import problems in getting it from |