Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Percentile Calculation #4

Copy link
Copy link
@vlad-bezden

Description

@vlad-bezden
Issue body actions

Hi,
In your example code/chapter3/solutions/percentile_score.py you have following code:

    if percentile == 0:
        return data[0]
    elif percentile == 100:
        return data[-1]

so for percentile == 0 it will return 1 and for percentile == 100 it returns 14
However based on the link that you provided Calculating Percentiles
percentile for 1 should be 7.1 and for 14 it should be 92.9
I checked other web sites and they all have different logic but most of them accept percentile from 1-99. 0 and 100 are invalid numbers.
So is there an error in your code?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.