Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
Hi Raymond, Thanks for working on this, I'm really keen to see this happen and I appreciate your efforts so far. Your arguments have also convinced me that the default calculation type you chose (PERCENTILE.EXC or R type=6) is suitable. But I have a couple of concerns about the API: 1. You call the parameter to choose a calculation definition "method"; I'm mildly concerned that might lead to some confusion or ambiguity with methods on a class. Do you think I'm worrying about nothing? R calls the same parameter "type", which I don't like either since that also has another meaning in Python. Numpy calls an equivalent parameter "interpolation", which I think is not only excessively long to type, but also misleading since at least two of the calculation methods used by numpy don't perform any interpolation at all. Octave and Maple call their parameter "method", so if we stick with "method" we're in good company. 2. I'm more concerned about the values taken by the method parameter. "Inclusive" and "Exclusive" have a related but distinct meaning when it comes to quartiles which is different from the Excel usage: Using range(1, 9) as the data: - standard "inclusive" or "exclusive" quartiles: 2.5, 4.5, 6.5 - Excel's "exclusive" quartiles (R type 6): 2.25, 4.5, 6.75 - Excel's "inclusive" quartiles (R type 7): 2.75, 4.5, 6.25 I'd prefer to keep inclusive/exclusive for such quartiles. I have a working version of quantiles() which supports cutpoints and all nine calculation methods supported by R. Following your lead, I've kept type=6 as the default. I need to tidy up the tests and inline docs, which time permitting I will do over the next 48 hours, and then it will be ready for initial review. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36546> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com