[SciPy-user] vectorize in scipy 0.3.2?

Nils Wagner nwagner at mecha.uni-stuttgart.de
Thu Oct 21 06:35:00 CDT 2004


Francesc Alted wrote:

>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])
>>>>        
>>>>
                               ^^^^^^^^^^^

                              s is missing

HTH,

               Nils

>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,
>
>  
>


 




More information about the SciPy-user mailing list