[SciPy-user] new scipy_core put syntax

Travis Oliphant oliphant at ee.byu.edu
Mon Oct 31 15:23:36 CST 2005


Christian Kristukat wrote:

>Hi,
>I installed the new scipy_core and have problems using 'put':
>
>In [1]:from scipy import *
>In [2]:a=zeros(10)
>In [3]:put(a,[2,3],3.4)
>---------------------------------------------------------------------------
>exceptions.TypeError                                 Traceback (most recent call 
>last)
>/home/ck/<console>
>/usr/lib/python2.3/site-packages/scipy/base/oldnumeric.py in put(a, ind, v)
>     163     a = array(a,copy=False)
>     164     v = array(v,copy=False)
>--> 165     return a.put(a, ind, v.astype(a.dtype))
>     166
>     167 def putmask (a, mask, v):
>TypeError: function takes exactly 2 arguments (3 given)
>
>Did the syntax change?
>  
>
No, this is a bug in the back-ported put function (which is now a method 
on the new array objects).  I've now fixed it.

a.put([2,3],3.4)  should get you what you want.

Thanks for the report.

-Travis



More information about the SciPy-user mailing list