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
Over at pydata/sparse#102, I ran into some issues about not being able to override where. I was thinking that if there was an if ufunc (suggestions for better names welcome) which selected from either x2 or x3 depending on x1, and made where call that, it would make overriding the three-argument version of where much simpler.
The slight problem I see with this is the following: where currently returns an ndarray, even for scalars. Maybe it'd be better if it decayed 0-d combinations to scalars anyway? I believe so.
Over the long term we might have __array_where__ but for the short term, using existing machinery, this will do.
The text was updated successfully, but these errors were encountered:
Over at pydata/sparse#102, I ran into some issues about not being able to override
where
. I was thinking that if there was anif
ufunc (suggestions for better names welcome) which selected from eitherx2
orx3
depending onx1
, and madewhere
call that, it would make overriding the three-argument version ofwhere
much simpler.The slight problem I see with this is the following:
where
currently returns anndarray
, even for scalars. Maybe it'd be better if it decayed 0-d combinations to scalars anyway? I believe so.Over the long term we might have
__array_where__
but for the short term, using existing machinery, this will do.The text was updated successfully, but these errors were encountered: