Changes elements of an array based on conditional and input values.
Similar to putmask(a, mask, vals) but the 1D array vals has the same number of elements as the non-zero values of mask. Inverse of extract.
Sets a.flat[n] = values[n] for each n where mask.flat[n] is true.
Parameters: | a : array_like
mask : array_like
values : array_like, shape(number of non-zero mask, )
|
---|