-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pick command for reduce #275
Comments
This would also be (very) useful for boolean, and integer, too, though it can be imitated fairly easily currently. I would expect it to work on all axes, for consistency, and sometimes that could actually be useful as well. For example, if you use a Regular axes to collect a range of dates, and you want to select one bin's worth of dates and look at the remaining remaining axes. |
It is definitely useful. This issue was stuck for a while, because it required a rewrite of the algorithm that indentifies and copies the corresponding bins from the old histogram to the new histogram. I had to write this new algorithm to make histograms with category axes addable, so this feature is less far away from reality as before. |
There are actually two distinct needs here. Using straw man terms for illustration, not intended to be the recommended names, just pointing out the two distinct uses:
|
It should be just one The limitation of the current implementation of reduce is that the axis types cannot change. A future rewrite of reduce should support converting axis types, to support It has low priority, but we could also add a |
Copied from #267:
scikit-hep/boost-histogram#296
suggests that one should be able to pick individual bin indices from a category axis. The suggested command is
pick(index1, index2, ...)
, as suggested by @henryiiiThe idea is good, but the implementation cost is not negligible.
pick
would only work for unordered axes like category. A new kind of reduce constructor must be defined and a corresponding reduce implementation must be written.The text was updated successfully, but these errors were encountered: