is_mask(m)
This function does not check the contents of the input, only that the type is MaskType. In particular, this function returns False if the mask has a flexible dtype.
Array to test.
True if :None:None:`m.dtype.type`
is MaskType, False otherwise.
Return True if m is a valid, standard mask.
ma.isMaskedArray
Test whether input is an instance of MaskedArray.
>>> import numpy.ma as maThis example is valid syntax, but we were not able to check execution
... m = ma.masked_equal([0, 1, 0, 2, 3], 0)
... m masked_array(data=[--, 1, --, 2, 3], mask=[ True, False, True, False, False], fill_value=0)
>>> ma.is_mask(m) FalseThis example is valid syntax, but we were not able to check execution
>>> ma.is_mask(m.mask) True
Input must be an ndarray (or have similar attributes) for it to be considered a valid mask.
This example is valid syntax, but we were not able to check execution>>> m = [False, True, False]This example is valid syntax, but we were not able to check execution
... ma.is_mask(m) False
>>> m = np.array([False, True, False])This example is valid syntax, but we were not able to check execution
... m array([False, True, False])
>>> ma.is_mask(m) True
Arrays with complex dtypes don't return True.
This example is valid syntax, but we were not able to check execution>>> dtype = np.dtype({'names':['monty', 'pithon'],This example is valid syntax, but we were not able to check execution
... 'formats':[bool, bool]})
... dtype dtype([('monty', '|b1'), ('pithon', '|b1')])
>>> m = np.array([(True, False), (False, True), (True, False)],This example is valid syntax, but we were not able to check execution
... dtype=dtype)
... m array([( True, False), (False, True), ( True, False)], dtype=[('monty', '?'), ('pithon', '?')])
>>> ma.is_mask(m) FalseSee :
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