jax.numpy.extract
Warning
This page was created from a pull request (#9655).
jax.numpy.extractΒΆ
- jax.numpy.extract(condition, arr)[source]ΒΆ
Return the elements of an array that satisfy some condition.
LAX-backend implementation of
extract()
.Original docstring below.
This is equivalent to
np.compress(ravel(condition), ravel(arr))
. If condition is booleannp.extract
is equivalent toarr[condition]
.Note that place does the exact opposite of extract.
- Parameters
condition (array_like) β An array whose nonzero or True entries indicate the elements of arr to extract.
arr (array_like) β Input array of the same size as condition.
- Returns
extract β Rank 1 array of values from arr where condition is True.
- Return type