原文:https://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.masked_inside.html
校对:(虚位以待)
numpy.ma.
masked_inside
(x, v1, v2, copy=True)[source]屏蔽给定间隔内的数组。
Shortcut to masked_where
, where condition is True for x inside the interval [v1,v2] (v1 <= x="" <="v2)." span="">边界v1和v2可以按任意顺序给出。=>
也可以看看
masked_where
笔记
数组x预填充其填充值。
例子
>>> import numpy.ma as ma
>>> x = [0.31, 1.2, 0.01, 0.2, -0.4, -1.1]
>>> ma.masked_inside(x, -0.3, 0.3)
masked_array(data = [0.31 1.2 -- -- -0.4 -1.1],
mask = [False False True True False False],
fill_value=1e+20)
v1和v2的顺序无关紧要。
>>> ma.masked_inside(x, 0.3, -0.3)
masked_array(data = [0.31 1.2 -- -- -0.4 -1.1],
mask = [False False True True False False],
fill_value=1e+20)