dask 2021.10.0

ParametersReturnsBackRef
masked_values(x, value, rtol=1e-05, atol=1e-08, shrink=True)

This docstring was copied from numpy.ma.masked_values.

Some inconsistencies with the Dask version may exist.

Return a MaskedArray, masked where the data in array x are approximately equal to :None:None:`value`, determined using isclose . The default tolerances for masked_values are the same as those for isclose .

For integer types, exact equality is used, in the same way as masked_equal .

The fill_value is set to :None:None:`value` and the mask is set to nomask if possible.

Parameters

x : array_like

Array to mask.

value : float

Masking value.

rtol, atol : float, optional

Tolerance parameters passed on to isclose

copy : bool, optional (Not supported in Dask)

Whether to return a copy of x.

shrink : bool, optional

Whether to collapse a mask full of False to nomask .

Returns

result : MaskedArray

The result of masking x where approximately equal to :None:None:`value`.

Mask using floating point equality.

See Also

masked_equal

Mask where equal to a given value (integers).

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  # doctest: +SKIP
... x = np.array([1, 1.1, 2, 1.1, 3]) # doctest: +SKIP
... ma.masked_values(x, 1.1) # doctest: +SKIP masked_array(data=[1.0, --, 2.0, --, 3.0], mask=[False, True, False, True, False], fill_value=1.1)

Note that :None:None:`mask` is set to nomask if possible.

This example is valid syntax, but we were not able to check execution
>>> ma.masked_values(x, 1.5)  # doctest: +SKIP
masked_array(data=[1. , 1.1, 2. , 1.1, 3. ],
             mask=False,
       fill_value=1.5)

For integers, the fill value will be different in general to the result of masked_equal .

This example is valid syntax, but we were not able to check execution
>>> x = np.arange(5)  # doctest: +SKIP
... x # doctest: +SKIP array([0, 1, 2, 3, 4])
This example is valid syntax, but we were not able to check execution
>>> ma.masked_values(x, 2)  # doctest: +SKIP
masked_array(data=[0, 1, --, 3, 4],
             mask=[False, False,  True, False, False],
       fill_value=2)
This example is valid syntax, but we were not able to check execution
>>> ma.masked_equal(x, 2)  # doctest: +SKIP
masked_array(data=[0, 1, --, 3, 4],
             mask=[False, False,  True, False, False],
       fill_value=2)
See :

Back References

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

dask.array.ma.masked_values dask.array.ma.masked_where dask.array.ma.masked_equal

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


File: /dask/array/ma.py#88
type: <class 'function'>
Commit: