[SciPy-user] convolve2d.. or Numeric to numarray conversion

Kasper Souren scipy-user@scipy.net
Fri, 14 Feb 2003 15:40:47 +0100


Hi!

I would like to do a 2D convolution. And as it seems there is a nice 
convolve2d in the Convolve package that comes with numarray, which doesn't 
seem available for Numeric or for SciPy.

The conversion from Numeric arrays to numarray arrays works fine with 1D 
arrays (numarray.array(list(a))). But for 2D arrays it gives me:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.2/site-packages/numarray/numarray.py", line 
313, in array
    return fromlist(buffer, type, shape)
  File "/usr/local/lib/python2.2/site-packages/numarray/numarray.py", line 
265, in fromlist
    arr.fromlist(seq)
TypeError: NA_setFromPythonScalar: bad value type.

Is there another easy way to convert Numeric arrays to numarray arrays? (And 
the reverse would also be handy to have, but that's for later.)

Or is there another simple way to do a 2D convolution of Numeric arrays?

And related to this problem: what are the plans regarding a possible move to 
using numarray instead of Numeric?

btw, it's a pity the "find" function of scipy.org is not working properly. 
Even just a plain google search would be nicer...

bye,
Kasper