[Numpy-discussion] ufunc void *extra

Marty Fuhry martyfuhry@gmail....
Sat Aug 22 20:15:17 CDT 2009

The "Beyond the Basics" manual
indicates that the generic ufunc loop (in this example loop1d) has a
void* extra (or void* data) argument that can be used to pass extra
data to the ufunc, but it doesn't indicate how to use this argument.

Can anyone tell me how to use this extra argument? I'm trying to get a
ufunc to perform a different operation by passing it a second
parameter, but I'm not sure how to do this.

>>> some_ufunc(narray, "A")
will perform operation A on object narray
>>> some_ufunc(narray, "B")
will perform operation B on object narray

Is this even a valid operation?

-Marty Fuhry

More information about the NumPy-Discussion mailing list