Skip to main content

select

Function select 

Source
pub fn select<T, D>(
    condlist: &[Array<bool, D>],
    choicelist: &[Array<T, D>],
    default: T,
) -> Result<Array<T, IxDyn>, FerrayError>
where T: Element, D: Dimension,
Expand description

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

Equivalent to np.select(condlist, choicelist, default). The first condition that is true determines which choice is used.

§Errors

  • InvalidValue if condlist and choicelist have different lengths
  • ShapeMismatch if shapes are incompatible