📜  numpy.where - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:53.896000             🧑  作者: Mango

代码示例2
Parameters:
condition : When True, yield x, otherwise yield y.
x, y : Values from which to choose. x, y and condition need to be broadcastable to some shape.

Returns:
out : [ndarray or tuple of ndarrays] If both x and y are specified, the output array contains elements of x where condition is True, and elements from y elsewhere.