Skip to content

Code Clean Up - groupby_helper.pxi.in #19724

Closed
@WillAyd

Description

@WillAyd

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions