@@ -565,6 +565,9 @@ def __getitem__(self, index): # noqa: C901
565565
566566 indexes = self ._compute_commonindex (index )
567567
568+ # Workaround for missing "pick" and no reduction on bool axes
569+ pick_bool = {}
570+
568571 # If this is (now) all integers, return the bin contents
569572 # But don't try *dict!
570573 if not hasattr (indexes , "items" ):
@@ -579,7 +582,11 @@ def __getitem__(self, index): # noqa: C901
579582 # Compute needed slices and projections
580583 for i , ind in enumerate (indexes ):
581584 if hasattr (ind , "__index__" ):
582- ind = slice (ind .__index__ (), ind .__index__ () + 1 , sum )
585+ if isinstance (self .axes [i ]._ax , _core .axis .boolean ):
586+ pick_bool [i ] = ind
587+ ind = slice (None , None , sum )
588+ else :
589+ ind = slice (ind .__index__ (), ind .__index__ () + 1 , sum )
583590
584591 elif not isinstance (ind , slice ):
585592 raise IndexError (
@@ -612,6 +619,13 @@ def __getitem__(self, index): # noqa: C901
612619
613620 slices .append (_core .algorithm .slice_and_rebin (i , start , stop , merge ))
614621
622+ for i , select in pick_bool .items ():
623+ self = self .copy ()
624+ view = self .view (flow = True )
625+ view [
626+ tuple (~ select if j == i else slice (None ) for j in range (self .ndim ))
627+ ] = 0
628+
615629 reduced = self ._hist .reduce (* slices )
616630
617631 if not integrations :
0 commit comments