On Apr 12, 2010, at 5:54 PM, Warren Weckesser wrote:

A bit more generalization of `by` gives behavior like matlab's accumarray (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/accumarray.html ),
which I partly cloned here:
[This would be a link to the scipy cookbook, but scipy.org is not
responding.]

Reading the accumarray docstring, it does seem related, but they use the "subs" array as an index into the original array (instead of an index into the "output" array like Robert's simplification). I do like the Matlab functionality, but would propose a different reduction function: reduceover to implement it.

It also feels like we should figure out different kinds of reductions for generalized ufuncs as well. If anyone has a primer on generalized ufuncs, I would love to see it. Isn't a reduction on a generalized ufunc just another generalized ufunc? Perhaps we could automatically create these "reduced generalized ufuncs"

I would love to explore just how general these generalized ufuncs are and what can be subsumed by them.


-Travis



_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to