Return an array drawn from elements in choicelist, depending on conditions.
Parameters : | condlist : list of bool ndarrays
choicelist : list of ndarrays
default : scalar, optional
|
---|---|
Returns : | output : ndarray
|
See also
Examples
>>> x = np.arange(10)
>>> condlist = [x<3, x>5]
>>> choicelist = [x, x**2]
>>> np.select(condlist, choicelist)
array([ 0, 1, 2, 0, 0, 0, 36, 49, 64, 81])