numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef
mask_rowcols(a, axis=None)

Mask whole rows and/or columns of a 2D array that contain masked values. The masking behavior is selected using the :None:None:`axis` parameter.

Notes

The input array's mask is modified by this function.

Parameters

a : array_like, MaskedArray

The array to mask. If not a MaskedArray instance (or if no array elements are masked). The result is a MaskedArray with :None:None:`mask` set to :None:None:`nomask` (False). Must be a 2D array.

axis : int, optional

Axis along which to perform the operation. If None, applies to a flattened version of the array.

Raises

NotImplementedError

If input array a is not 2D.

Returns

a : MaskedArray

A modified version of the input array, masked depending on the value of the :None:None:`axis` parameter.

Mask rows and/or columns of a 2D array that contain masked values.

See Also

mask_cols

Mask cols of a 2D array that contain masked values.

mask_rows

Mask rows of a 2D array that contain masked values.

masked_where

Mask where a condition is met.

Examples

This example is valid syntax, but we were not able to check execution
>>> import numpy.ma as ma
... a = np.zeros((3, 3), dtype=int)
... a[1, 1] = 1
... a array([[0, 0, 0], [0, 1, 0], [0, 0, 0]])
This example is valid syntax, but we were not able to check execution
>>> a = ma.masked_equal(a, 1)
... a masked_array( data=[[0, 0, 0], [0, --, 0], [0, 0, 0]], mask=[[False, False, False], [False, True, False], [False, False, False]], fill_value=1)
This example is valid syntax, but we were not able to check execution
>>> ma.mask_rowcols(a)
masked_array(
  data=[[0, --, 0],
        [--, --, --],
        [0, --, 0]],
  mask=[[False,  True, False],
        [ True,  True,  True],
        [False,  True, False]],
  fill_value=1)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.ma.extras.mask_rows numpy.ma.extras.mask_cols

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/ma/core.py#7457
type: <class 'function'>
Commit: