Skip to content

Commit

Permalink
improved explanation of linear interpolation in quantile
Browse files Browse the repository at this point in the history
  • Loading branch information
Detoro committed Aug 18, 2023
1 parent c92b370 commit e91ea5e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2683,8 +2683,10 @@ def quantile(
This optional parameter specifies the interpolation method to use,
when the desired quantile lies between two data points `i` and `j`:
* linear: `i + (j - i) * fraction`, where `fraction` is the
fractional part of the index surrounded by `i` and `j`.
* linear: `i + (j - i) * fraction`, where `fraction` is the proportion
of the distance between `i` and `j`. it refers to the relative position
of the desired quantile value between i and j
hence fraction = (desired_quantile - i) / (j - i)
* lower: `i`.
* higher: `j`.
* nearest: `i` or `j` whichever is nearest.
Expand Down

0 comments on commit e91ea5e

Please sign in to comment.