Re: [Numpy-discussion] ndarray allocation question

2007-04-10 Thread David Doukhan
2007/4/10, Travis Oliphant <[EMAIL PROTECTED]>: > David Doukhan wrote: > > >Sorry, i thought doing the following lines: > > > >clib = ctypes.cdll.LoadLibrary("./libtest.so") > >dt = numpy.dtype({'names' : ['x'], 'formats' : [N.float32]}, align=67) > >myarray = numpy.empty((5,6,7),dtype=dt) > > > >w

Re: [Numpy-discussion] ndarray allocation question

2007-04-10 Thread Travis Oliphant
David Doukhan wrote: >Sorry, i thought doing the following lines: > >clib = ctypes.cdll.LoadLibrary("./libtest.so") >dt = numpy.dtype({'names' : ['x'], 'formats' : [N.float32]}, align=67) >myarray = numpy.empty((5,6,7),dtype=dt) > >would create an array such than when doing : > >my_pointer = myarr

[Numpy-discussion] ANN: PyQwt-5.0.0 released

2007-04-10 Thread Gerard Vermeulen
What is PyQwt ( http://pyqwt.sourceforge.net ) ? - it is a set of Python bindings for the Qwt C++ class library which extends the Qt framework with widgets for scientific and engineering applications. It provides a widget to plot 2-dimensional data and various widgets to display and contro

Re: [Numpy-discussion] making two 2D real arrays into one complex array

2007-04-10 Thread Robert Kern
mark wrote: > Hello List - > > Any reason why the following doesn't work? > x,y = meshgrid(linspace(-1,1,10),linspace(-1,1,10)) z = complex(x,y) > Traceback (most recent call last): > File "", line 1, in ? > z = complex(x,y) > TypeError: only length-1 arrays can be converted to Py

Re: [Numpy-discussion] making two 2D real arrays into one complex array

2007-04-10 Thread Pierre GM
On Tuesday 10 April 2007 15:57:00 mark wrote: > Hello List - > > Any reason why the following doesn't work? > > >>> x,y = meshgrid(linspace(-1,1,10),linspace(-1,1,10)) > >>> z = complex(x,y) Because complex is a python function that doesn't work well w/ ndarrays. int/float/bool would give the sam

Re: [Numpy-discussion] ndarray allocation question

2007-04-10 Thread David Doukhan
2007/4/10, Travis Oliphant <[EMAIL PROTECTED]>: > David Doukhan wrote: > > Hi! > > I'm writing you this mail because I would like to do "advanced" use of > > ndarray memory allocation. > > > > So here is a short description of my problem: > > > > I'm interfacing multidimensionnal Numpy array to C u

[Numpy-discussion] making two 2D real arrays into one complex array

2007-04-10 Thread mark
Hello List - Any reason why the following doesn't work? >>> x,y = meshgrid(linspace(-1,1,10),linspace(-1,1,10)) >>> z = complex(x,y) Traceback (most recent call last): File "", line 1, in ? z = complex(x,y) TypeError: only length-1 arrays can be converted to Python scalars I know I can ma

Re: [Numpy-discussion] cannot import name ccompiler

2007-04-10 Thread Jason Braswell
Ah, thank you kindly...worked like a charm. On 4/10/07, Robert Kern <[EMAIL PROTECTED]> wrote: Jason Braswell wrote: > Hi, folks. I'm a newbie trying to get started with SciPy on Windows. I > installed it without problem, but when I try to import the SciPy module > or run the 'numpy' test, I

Re: [Numpy-discussion] cannot import name ccompiler

2007-04-10 Thread Robert Kern
Jason Braswell wrote: > Hi, folks. I'm a newbie trying to get started with SciPy on Windows. I > installed it without problem, but when I try to import the SciPy module > or run the 'numpy' test, I get the following output: > *** > Traceback (most recen

[Numpy-discussion] cannot import name ccompiler

2007-04-10 Thread Jason Braswell
Hi, folks. I'm a newbie trying to get started with SciPy on Windows. I installed it without problem, but when I try to import the SciPy module or run the 'numpy' test, I get the following output: *** Traceback (most recent call last): File "", line 1,

Re: [Numpy-discussion] combining two arrays into one

2007-04-10 Thread mark
Yes, dstack is what I need. Thanks for the quick response, Mark On 10 apr, 15:38, "Bill Baxter" <[EMAIL PROTECTED]> wrote: > I'm pretty sure dstack([x,y]) is what you're after. > > --bb > > On 4/10/07, mark <[EMAIL PROTECTED]> wrote: > > > Hello list - > > > I want to combine two arrays into one,

Re: [Numpy-discussion] combining two arrays into one

2007-04-10 Thread Bill Baxter
I'm pretty sure dstack([x,y]) is what you're after. --bb On 4/10/07, mark <[EMAIL PROTECTED]> wrote: > Hello list - > > I want to combine two arrays into one, and I cannot find a clean way > to do it. > > I have the following two arrays: > > >>> x = array([[1, 2, 3], >[4, 5, 6]])

[Numpy-discussion] combining two arrays into one

2007-04-10 Thread mark
Hello list - I want to combine two arrays into one, and I cannot find a clean way to do it. I have the following two arrays: >>> x = array([[1, 2, 3], [4, 5, 6]]) >>> y = array([[10, 20, 30], [40, 50, 60]]) Now I want to make a new array z, such that z[:,:,0] gives