Closed
Description
A few of the methods in groupby_helper.pxi.in
have a pattern that goes:
N, K = (<object> values).shape
with nogil:
if K > 1:
# loop over j in range(K) and do stuff
...
else:
# do stuff with j=0
...
Unless I'm missing something simple I don't think there's a reason to have the conditional and duplicate code branches. In the case where K=1 (which is all the time?) then the for j in range(K)
construct inherently sets j=0
, bypassing the need for the conditional