mathics / Mathics

This repository is for archival. Please see https://github.com/Mathics3/mathics-core

Home Page:https://mathics.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quantile[Range[16], 1/4] wrong result?

axkr opened this issue · comments

Example in Quantile doc:

Quantile[Range[16], 1/4]

returns 5 should be 4 in Docker container.

This is hand-hacked code. I'd like to replace it with numpy's or scipy's version. However for numpy

import numpy
>>> numpy.quantile(range(1, 17), 1/4)
4.75
>>> import scipy.stats.mstats
scipy.stats.mstats.mquantiles(range(1,17), 1/4)
array([4.45])

The Details section in https://reference.wolfram.com/language/ref/Quantile.html provides details and rules for how to do.