[Python-ideas] Adding quantile to the statistics module
guillaumeplique at gmail.com
Thu Mar 15 15:39:27 EDT 2018
Sorry if this subject has already been covered in the mailing list but I
could not find it.
My question is very simple: should the `quantile` function be added to
python `statistics` module.
I was very happy to learn the existence of this module in python3 only to
later be forced to install numpy to compute a .7 quantile which is even
more frustrating since the module actually provides an implementation of
I would therefore be willing to submit a PR to add the `quantile` function
to the module.
The function would have the following signature:
# data -> your sequence
# p -> the quantile, between 0 & 1
def quantile(data, p)
quantile([1, 2, 3, 4, 5], 0.5)
This would also mean implementing very simply the `quantile_low` &
`quantile_high` function as their median counterparts in the module.
I am unclear, however, how to implement a hypothetic `quantile_grouped`.
What do you think?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas