On 28.03.2011 09:49, Raymond Hettinger wrote: > > On Mar 28, 2011, at 12:38 AM, Daniel Stutzbach wrote: > >> On Sun, Mar 27, 2011 at 10:53 PM, Nick Coghlan <ncogh...@gmail.com >> <mailto:ncogh...@gmail.com>> wrote: >> >> On Mon, Mar 28, 2011 at 2:11 PM, Daniel Stutzbach <stutzb...@google.com >> <mailto:stutzb...@google.com>> wrote: >> > Is there a good use-case for the func argument? >> >> >> >> The examples that Raymond gives in the docs (cumulative >> multiplication, running min/max, cash flow accumulation) look fairly >> solid to me. >> >> >> (I had the nagging suspicion that I was making a blunder in my email, but I >> couldn't see it despite rereading my email several times before sending. My >> blunder was in not rereading the patch to see the examples. Anyway...) >> >> When would a running product, min, or max be useful? > > There's no need to speculate. This API has long been present in other > languages > and libraries. > > Do a google code search for R's builtin functions cumsum, cumprod, cummin, and > cummax. Look at mumpy's accumulate ufunc which works with many operators. APL > and K also have an accumulate tool which takes arbitrary functions.
And incidentally I just could have used it myself yesterday. So thanks for adding it! :) Georg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com