[SciPy-user] newscipy interp1d

Christian Kristukat ckkart at hoc.net
Sat Dec 10 13:01:00 CST 2005


Christian Kristukat wrote:
> Hi,
> I get errors when using scipy.interpolate.interp1d from newscipy like the following:
> 
> x=linspace(-1,4,20)
> y=x**2
> ip=interp1e(x,y)
> xn=linspace(-.5,1,200)
> yn=ip(xn)
> 
> Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
>    File "/usr/lib/python2.4/site-packages/scipy/interpolate/interpolate.py", 
> line 180, in __call__
>      putmask(y_new, new_out.ravel(), self.fill_value)
>    File "/usr/lib/python2.4/site-packages/scipy/base/oldnumeric.py", line 187, 
> in putmask
>      return a.putmask(v, mask)
> TypeError: array cannot be safely cast to required type
> 
> I guess this a bug.?
> 

I found out that putmask is not accepting an array object as mask, a python list 
however is ok. I guess this is not the intended behaviour?

Christian





More information about the SciPy-user mailing list