[Numpy-discussion] ENH: ratio function to mimic diff

Joseph Fox-Rabinovitz jfoxrabinovitz at gmail.com
Fri Jul 28 18:25:11 EDT 2017

I have created PR#9481 to introduce a `ratio` function that behaves very
similarly to `diff`, except that it divides successive elements instead of
subtracting them. It has some handling built in for zero division, as well
as the ability to select between `/` and `//` operators.

There is currently no masked version. Perhaps someone could suggest a
simple mechanism for hooking np.ma.true_divide and np.ma.floor_divide in as
the operators instead of the regular np.* versions.

Please let me know your thoughts.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20170728/0890a39b/attachment.html>

More information about the NumPy-Discussion mailing list