You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
numpy.where takes three arguments (ignore the single-argument version: it's equivalent to nonzero and we can do that other ways):
condition, a boolean array
x, any array
y, any array
and returns a single array with x values if condition is true and y values if condition is false.
We can do this in Awkward even if x and y are not the same type; ak.where would return a UnionArray (my issue #54).
If x and y do have the same type, we can return something simpler. Actually, we can do well by implementing the general case with UnionArray first, then add special cases like "both are NumpyArrays of the same format" or "both have ListType with compatible content," one by one as needed.
The text was updated successfully, but these errors were encountered:
numpy.where takes three arguments (ignore the single-argument version: it's equivalent to
nonzero
and we can do that other ways):condition
, a boolean arrayx
, any arrayy
, any arrayand returns a single array with
x
values ifcondition
istrue
andy
values ifcondition
is false.We can do this in Awkward even if
x
andy
are not the same type;ak.where
would return a UnionArray (my issue #54).If
x
andy
do have the same type, we can return something simpler. Actually, we can do well by implementing the general case withUnionArray
first, then add special cases like "both areNumpyArrays
of the sameformat
" or "both have ListType with compatiblecontent
," one by one as needed.The text was updated successfully, but these errors were encountered: