cupynumeric.where#

cupynumeric.where(
a: npt.ArrayLike | ndarray,
x: None,
y: None,
) tuple[ndarray, ...]#
cupynumeric.where(
a: npt.ArrayLike | ndarray,
x: npt.ArrayLike | ndarray,
y: npt.ArrayLike | ndarray,
) ndarray

where(condition, [x, y])

Return elements chosen from x or y depending on condition.

Parameters:
  • condition (array_like, bool) – Where True, yield x, otherwise yield y.

  • x (array_like) – Values from which to choose. x, y and condition need to be broadcastable to some shape.

  • y (array_like) – Values from which to choose. x, y and condition need to be broadcastable to some shape.

Returns:

out – An array with elements from x where condition is True, and elements from y elsewhere.

Return type:

ndarray

See also

numpy.where

Availability:

Multiple GPUs, Multiple CPUs