[SciPy-user] vectorize in scipy 0.3.2?
Francesc Alted
falted at pytables.org
Thu Oct 21 07:21:50 EDT 2004
Hi,
I'm having problems with the vectorize function of scipy. Look:
$ python
Python 2.3.4 (#1, Jul 22 2004, 20:47:54)
[GCC 3.3.2 20031022 (Red Hat Linux 3.3.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from scipy import *
>>> def addsubtract(a,b):
... if a > b:
... return a - b
... else:
... return a + b
...
>>> vec_addsubstract = vectorize(addsubtract)
>>> vec_addsubtract([0,3,6,9],[1,3,5,7])
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'vec_addsubtract' is not defined
and I've tested it on a debian box, with debian packages
(http://deb-scipy.alioth.debian.org/apt) with the same result.
Some hint?
Cheers,
--
Francesc Alted
More information about the SciPy-User
mailing list