Repository navigation
Closes #5373: where to allow bool_scalars - #5374
Merged
ajpotts merged 1 commit intoFeb 11, 2026
Merged
Conversation
ajpotts
force-pushed
the
5373_where_to_allow_bool_scalars
branch
2 times, most recently
from
February 9, 2026 23:57
4b375b6 to
edfa2e4
Compare
ajpotts
force-pushed
the
5373_where_to_allow_bool_scalars
branch
3 times, most recently
from
February 10, 2026 11:10
94248d4 to
78843f6
Compare
ajpotts
marked this pull request as ready for review
February 10, 2026 11:31
1RyanK
approved these changes
Feb 11, 2026
1RyanK
left a comment
Contributor
There was a problem hiding this comment.
Minor performance issue on
In [7]: import time
...: import arkouda as ak
...:
...: n = 20_000_000
...: x = ak.ones(n, dtype=ak.int64)
...: y = ak.zeros(n, dtype=ak.int64)
...:
...: def time_where(cond):
...: t0 = time.time()
...: r = ak.where(cond, x, y)
...: # force evaluation
...: s = int(r.sum())
...: t1 = time.time()
...: return (t1 - t0), s
...:
...: # Baseline: just sum x directly (should be fast-ish, no where mask)
...: t0 = time.time()
...: sx = int(x.sum())
...: t1 = time.time()
...: print("baseline x.sum() sec:", round(t1-t0, 3), "sum:", sx)
...:
...: dt_true, s_true = time_where(True)
...: print("where(True, x, y) sec:", round(dt_true, 3), "sum:", s_true)
...:
...: dt_false, s_false = time_where(False)
...: print("where(False, x, y) sec:", round(dt_false, 3), "sum:", s_false)
...:
baseline x.sum() sec: 0.023 sum: 20000000
where(True, x, y) sec: 0.13 sum: 20000000
where(False, x, y) sec: 0.122 sum: 0
ajpotts
force-pushed
the
5373_where_to_allow_bool_scalars
branch
from
February 11, 2026 16:37
78843f6 to
aeb5ae7
Compare
1RyanK
approved these changes
Feb 11, 2026
1RyanK
approved these changes
Feb 11, 2026
ajpotts
force-pushed
the
5373_where_to_allow_bool_scalars
branch
from
February 11, 2026 21:39
c9ad74d to
361c42d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5373: where to allow bool_scalars