<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 27, 2019 at 7:51 AM Steven D'Aprano <<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The statistics module is soon to get a quantile function.<br>
<br>
For those of you who use statistics software (whether in Python, or <br>
using other languages) and specifically use quantiles, what sort of <br>
functionality would be useful to you?<br>
<br>
For example:<br>
<br>
- evenly-spaced quantiles (say, at 0.25, 0.5, 0.75)?<br>
- unevenly-spaced quantiles (0.25, 0.8, 0.9, 0.995)?<br>
- one quantile at a time?<br>
- any specific definition?<br>
- quantiles of a distribution?<br>
- anything else?<br></blockquote><div><br></div><div>The stats that are pored over by my team every week are running times of mypy in various configurations. We currently show p25, p50, p75, p90, p95 and p99. We currently use the following definition:</div><div><br></div><div>def pick(data: List[float], fraction: float) -> float:<br>    index = int(len(data) * fraction)<br>    before = data[max(0, index - 1)]<br>    after = data[min(len(data) - 1, index)]<br>    return (before + after) / 2.0<br></div><div><br></div><div>where `data` is a sorted array. Essentially we use the average of the two values nearest the cutoff point, except for edge cases. (I think we could do better, but this is the code I found in our repo. :-)<br></div></div><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div><div><i style="font-family:Arial,Helvetica,sans-serif;font-size:small;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);color:rgb(136,136,136)"><span>Pronouns</span>: he/him/his </i><a href="http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/" style="color:rgb(17,85,204);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)" target="_blank"><i>(why is my <span>pronoun</span> here?)</i></a></div></div></div></div></div>