# [PYTHON MATRIX-SIG] Applying a general function to an array

**James Hugunin
**
jjh@Goldilocks.LCS.MIT.EDU

*Thu, 22 Feb 96 12:35:06 EST*

An example of the sort of function you want to do this with would be
very helpful in answering this. Many python functions already work as
you describe.
ie. (This is from my memory of how RBF NN's work)
Say I have a Radial Basis Function Neural Net and I want the user to
be able to give a python function the input RBF (actually this would
be nice thing to have):
The standard RBF function is (from memory, I last worked on these
things years ago):
def gaussian(x, A, B, C):
return A*exp(B*(x-C)**2)
This function wil normally just work for any reasonable combination of
1d, 2d arrays and scalars.
>* In a similar vein, is there documentation for
*>* 1. the Array C API
*
arrayobject.h provides some minimal documentation on this. I'd look
at the various modules that people have produced for examples.
>* 2. ofuncs
*
I doubt that there will be much need for additional ofuncs in the
future. They are currently only really useful for binary functions
that need to operate over a large variety of array types, and need to
be applied in numerous interesting ways (pseudo indices, reduction,
etc.) If you have something that you really think should be an ofunc,
I'd like to know some more of the details.
-Jim
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================