Re: [Numpy-discussion] Strange behaviour of numpy.asarray() in corner case

2011-01-31 Thread Friedrich Romstedt
2011/2/1 Warren Weckesser : >>  Shall I file a ticket? > > Yes. Ok, #1730: http://projects.scipy.org/numpy/ticket/1730. Thanks, Friedrich ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussio

Re: [Numpy-discussion] Strange behaviour of numpy.asarray() in corner case

2011-01-31 Thread Warren Weckesser
On Mon, Jan 31, 2011 at 8:32 PM, Friedrich Romstedt < friedrichromst...@gmail.com> wrote: > 2011/1/28 Friedrich Romstedt : > numpy.asarray([X(), numpy.asarray([1, 1])]).shape > > (2,) > numpy.asarray([numpy.asarray([1, 1]), X()]).shape > > () > > Does noone have an opinion about this?

Re: [Numpy-discussion] Strange behaviour of numpy.asarray() in corner case

2011-01-31 Thread Friedrich Romstedt
2011/1/28 Friedrich Romstedt : numpy.asarray([X(), numpy.asarray([1, 1])]).shape > (2,) numpy.asarray([numpy.asarray([1, 1]), X()]).shape > () Does noone have an opinion about this? Shall I file a ticket? Friedrich ___ NumPy-Discussion mailin

Re: [Numpy-discussion] using loadtxt() for given number of rows?

2011-01-31 Thread Christopher Barker
On 1/31/11 4:39 AM, Robert Cimrman wrote: > I work with text files which contain several arrays separated by a few > lines of other information, for example: > > POINTS 4 float > -5.00e-01 -5.00e-01 0.00e+00 > 5.00e-01 -5.00e-01 0.00e+00 > 5.00e-01 5.00e-01 0.00e

Re: [Numpy-discussion] create a numpy array of images

2011-01-31 Thread Zachary Pincus
>>> I am using python for a while now and I have a requirement of >>> creating a >>> numpy array of microscopic tiff images ( this data is 3d, meaning >>> there are >>> 100 z slices of 512 X 512 pixels.) How can I create an array of >>> images? >> >> It's quite straightforward to create a 3-d

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-31 Thread Algis Kabaila
On Tuesday 01 February 2011 03:27:22 Sturla Molden wrote: > Den 31.01.2011 03:05, skrev Algis Kabaila: > > Actually, the structural engineer > > has no interest in trying to invert a singular matrix. > > However he/she is interested (or should be interested :) > > ) when the square response matri

Re: [Numpy-discussion] numpy.linalg.svd documentation

2011-01-31 Thread Sturla Molden
Den 30.01.2011 21:40, skrev Charles R Harris: > Well, strictly speaking, both documentations say the same thing, but > the old version was somewhat obfuscated. Either svd returns v.H and A > = dot(u*d, v.H) or svd returns v and A = dot(u*d,v). I think the > second is a clearer statement of the r

Re: [Numpy-discussion] Vectorize or rewrite function to work with array inputs?

2011-01-31 Thread eat
Hi, On Mon, Jan 31, 2011 at 5:15 PM, wrote: > I have several functions like the example below that I would like to make > compatible with array inputs. The problem is the conditional statements give > a *ValueError: The truth value of an array with more than one element is > ambiguous. Use a.any

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-31 Thread Sturla Molden
Den 31.01.2011 03:05, skrev Algis Kabaila: > Actually, the structural engineer > has no interest in trying to invert a singular matrix. However > he/she is interested (or should be interested :) ) when the > square response matrix might approach singularity for this would > signal instability. I

Re: [Numpy-discussion] Vectorize or rewrite function to work with array inputs?

2011-01-31 Thread Sebastian Berg
Hello, On Mon, 2011-01-31 at 10:15 -0500, dpar...@chromalloy.com wrote: > I have several functions like the example below that I would like to > make compatible with array inputs. The problem is the conditional > statements give a ValueError: The truth value of an array with more > than one elemen

[Numpy-discussion] Vectorize or rewrite function to work with array inputs?

2011-01-31 Thread DParker
I have several functions like the example below that I would like to make compatible with array inputs. The problem is the conditional statements give a ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all(). I can use numpy.vectorize, but if pos

[Numpy-discussion] using loadtxt() for given number of rows?

2011-01-31 Thread Robert Cimrman
Hi, I work with text files which contain several arrays separated by a few lines of other information, for example: POINTS 4 float -5.00e-01 -5.00e-01 0.00e+00 5.00e-01 -5.00e-01 0.00e+00 5.00e-01 5.00e-01 0.00e+00 -5.00e-01 5.00e-01 0.00e+00 CELL

Re: [Numpy-discussion] Generator arrays

2011-01-31 Thread Neal Becker
I'm not sure how it applies to this discussion, but I'd just like to mention that a lot of interest (in c++ and d communities) has moved away from using iterators as the fundamental interface to containers and to ranges as the interface. ___ NumPy-Dis

Re: [Numpy-discussion] create a numpy array of images

2011-01-31 Thread totonixs...@gmail.com
I've been done that but with CT and MRI dicom files, and the cool thing is that with numpy I can do something like this: # getting axial slice axial = slices[n,:,:] # getting coronal slice coronal = slices[:, n, :] # getting sagital slice sagital = slices[:,:, n] On Sun, Jan 30, 2011 at 5:29 PM