numpy.ma.MaskedArray.round#
method
- ma.MaskedArray.round(decimals=0,out=None)[source]#
Return each element rounded to the given number of decimals.
Refer to
numpy.aroundfor full documentation.See also
numpy.ndarray.roundcorresponding function for ndarrays
numpy.aroundequivalent function
Examples
>>>importnumpyasnp>>>importnumpy.maasma>>>x=ma.array([1.35,2.5,1.5,1.75,2.25,2.75],...mask=[0,0,0,1,0,0])>>>ma.round(x)masked_array(data=[1.0, 2.0, 2.0, --, 2.0, 3.0], mask=[False, False, False, True, False, False], fill_value=1e+20)
On this page