@@ -615,14 +615,9 @@ def _aggregate(
615
615
is_datetimelike ,
616
616
min_count = - 1 ,
617
617
):
618
- if values .ndim > 3 :
618
+ if values .ndim > 2 :
619
619
# punting for now
620
- raise NotImplementedError ("number of dimensions is currently limited to 3" )
621
- elif values .ndim > 2 :
622
- for i , chunk in enumerate (values .transpose (2 , 0 , 1 )):
623
-
624
- chunk = chunk .squeeze ()
625
- agg_func (result [:, :, i ], counts , chunk , comp_ids , min_count )
620
+ raise NotImplementedError ("number of dimensions is currently limited to 2" )
626
621
else :
627
622
agg_func (result , counts , values , comp_ids , min_count )
628
623
@@ -640,20 +635,9 @@ def _transform(
640
635
):
641
636
642
637
comp_ids , _ , ngroups = self .group_info
643
- if values .ndim > 3 :
638
+ if values .ndim > 2 :
644
639
# punting for now
645
- raise NotImplementedError ("number of dimensions is currently limited to 3" )
646
- elif values .ndim > 2 :
647
- for i , chunk in enumerate (values .transpose (2 , 0 , 1 )):
648
-
649
- transform_func (
650
- result [:, :, i ],
651
- values ,
652
- comp_ids ,
653
- ngroups ,
654
- is_datetimelike ,
655
- ** kwargs
656
- )
640
+ raise NotImplementedError ("number of dimensions is currently limited to 2" )
657
641
else :
658
642
transform_func (result , values , comp_ids , ngroups , is_datetimelike , ** kwargs )
659
643
@@ -932,11 +916,7 @@ def _chop(self, sdata, slice_obj):
932
916
class FrameSplitter (DataSplitter ):
933
917
def fast_apply (self , f , names ):
934
918
# must return keys::list, values::list, mutated::bool
935
- try :
936
- starts , ends = lib .generate_slices (self .slabels , self .ngroups )
937
- except Exception :
938
- # fails when all -1
939
- return [], True
919
+ starts , ends = lib .generate_slices (self .slabels , self .ngroups )
940
920
941
921
sdata = self ._get_sorted_data ()
942
922
return libreduction .apply_frame_axis0 (sdata , f , names , starts , ends )
0 commit comments