On Sun, 2025-06-08 at 00:40 +0000, Carlos Martin wrote: > Add a reverse argument to accumulating functions that, when true, > causes the accumulation to be performed in reverse. Examples:
Can you describe use cases? Without that, I am not sure I find the flip solution terrible enough for a very uncommon need. (For ufuncs, if you improved stride support `out=` might allow making the flip no-cost also.) - Sebastian > > - ufunc.accumulate: > https://numpy.org/doc/stable/reference/generated/numpy.ufunc.accumulate.html > - cumsum: > https://numpy.org/doc/stable/reference/generated/numpy.cumsum.html > - nancumsum: > https://numpy.org/doc/stable/reference/generated/numpy.nancumsum.html > - cumprod: > https://numpy.org/doc/stable/reference/generated/numpy.cumprod.html > - nancumprod: > https://numpy.org/doc/stable/reference/generated/numpy.nancumprod.html > > Currently, this can be done via two flips > (https://numpy.org/doc/stable/reference/generated/numpy.flip.html) > before and after the operation. But it might be more efficient to do > it directly at the low level. > _______________________________________________ > NumPy-Discussion mailing list -- numpy-discussion@python.org > To unsubscribe send an email to numpy-discussion-le...@python.org > https://mail.python.org/mailman3//lists/numpy-discussion.python.org > Member address: sebast...@sipsolutions.net > _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3//lists/numpy-discussion.python.org Member address: arch...@mail-archive.com