Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
correct quantile to handle unsorted quantiles
Currently dask.dataframe.core.quantile(df, q) can silently give incorrect results when the list of quantiles, q, is not sorted. For instance quantile(dask.array.arange(100), [0.75, 0.50, 0.25]) gives incorrect results. This patch uses numpy's mergesort to ensure that the quantiles are sorted. Note that with the patch behavior still differs from that in pandas.DataFrame.quantile() where quantiles are calculated correctly while preserving order. While this patch does not duplicate the behavior of pandas because it does not preserve the order of the quantiles, it does at least avoids the silent errors.
- Loading branch information