-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Description
This occurred to me while reading mbauman@d83dad3:
to select elements of ``A`` equal to 1 or 2 use ``(A .== 1) | (A .== 2)``).
What do you think about having an element-wise in operator? Despite not having a dedicated symbol, I think in is a true operator, and it's the only one without an element-wise version.
This would allow writing e.g. A .in (1, 2) instead of the convoluted form above (and thus reduce priority mistakes). It's very useful when working with data where you often need to test for equality against a longer series of values; or simply when testing for equality against a set of values stored in a variable.
I grant you .in looks a little weird, but not more than .!=. ;-)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels