[SciPy-User] Can I create a 3 argument UFunc easily?
Tue Jun 8 17:46:28 CDT 2010
I would like to make a 3 argument UFunc that finds the weighted average of
two of the arguments using the 3rd argument as the weight. This way, the
.accumulate method of the ufunc can be used as an exponentially weighted
moving average function.
Unfortunately I am not very familiar with the Numpy C API, so I was hoping
to use the Cython hack for making UFuncs (
http://wiki.cython.org/MarkLodato/CreatingUfuncs). However, looking at the
UFunc C API doc (http://docs.scipy.org/doc/numpy/reference/c-api.ufunc.html),
it looks like numpy only has 2 argument "generic functions". Is there a
simple way to create a "generic function" that takes 3 arguments that will
still work with accumulate? Is there another way to create the sort of UFunc
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User