MAINT: Update quantile default lerp method#20331
Conversation
For method 7 of H&F, using `(n - 1) * quantiles` instead of the usual method gives a more accurate result.
|
Should/can we add a test for this thing by checking that the quantile of data and the quantile of the data repeated a few times is identical? |
|
I was wondering how to test it. |
|
Yeah, you are right. I didn't realize that the reason for the difference was that pandas probably implements its own quantile version there and ULPs just add up slightly differently. Lets see if this helps pandas. If not, I expect pandas should relax their test. The only test I could think of is asserting a specific result with max-ULPs... |
0176a19 to
53e3df3
Compare
|
Thanks! I dumbed the test down and just hardcoded the expected value, will merge once tests pass. Hopefully the 1ULP won't fail for some reason, but I will expect that IEEE compliant doubles will always lead to this... |
|
Thanks @bzah (the MacOS job timed out, going to ignore that, maybe bumping the mac os version will help with that job being so slow recently). |
For method 7 of H&F, using
(n - 1) * quantilesgives a more accurate result than_compute_virtual_index(n, quantiles, 1, 1).It should fix: pandas-dev/pandas#44343