dask 2021.10.0

ParametersReturnsBackRef
select(condlist, choicelist, default=0)

This docstring was copied from numpy.select.

Some inconsistencies with the Dask version may exist.

Parameters

condlist : list of bool ndarrays

The list of conditions which determine from which array in :None:None:`choicelist` the output elements are taken. When multiple conditions are satisfied, the first one encountered in :None:None:`condlist` is used.

choicelist : list of ndarrays

The list of arrays from which the output elements are taken. It has to be of the same length as :None:None:`condlist`.

default : scalar, optional

The element inserted in :None:None:`output` when all conditions evaluate to False.

Returns

output : ndarray

The output at position m is the m-th element of the array in :None:None:`choicelist` where the m-th element of the corresponding array in :None:None:`condlist` is True.

Return an array drawn from elements in choicelist, depending on conditions.

See Also

choose
compress
diag
diagonal
take
where

Return elements from one of two arrays depending on condition.

Examples

This example is valid syntax, but we were not able to check execution
>>> x = np.arange(6)  # doctest: +SKIP
... condlist = [x<3, x>3] # doctest: +SKIP
... choicelist = [x, x**2] # doctest: +SKIP
... np.select(condlist, choicelist, 42) # doctest: +SKIP array([ 0, 1, 2, 42, 16, 25])
This example is valid syntax, but we were not able to check execution
>>> condlist = [x<=4, x>3]  # doctest: +SKIP
... choicelist = [x, x**2] # doctest: +SKIP
... np.select(condlist, choicelist, 55) # doctest: +SKIP array([ 0, 1, 2, 3, 4, 25])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

dask.array.routines.piecewise dask.array.routines.compress

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/array/routines.py#2146
type: <class 'function'>
Commit: