Skip to content

minor inefficency in the statistics module #154947

Description

@lbaumbauer

Bug report

Bug description:

j = i * m // n # rescale i to m/n

in the quantiles computation 'i * m' should be reused not recomputed ( #150326) changes not added here)

            i_m = i * m
            j =  i_m // n                               # rescale i to m/n
            j = 1 if j < 1 else ld-1 if j > ld-1 else j  # clamp to 1 .. ld-1
            delta = i_m - j*n 

CPython versions tested on:

3.13

Operating systems tested on:

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedperformancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions