Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread Maria Liukis
Josef, Many thanks for the example! It should become an official NumPy recipe :) Thanks again, Masha liu...@usc.edu On Aug 17, 2009, at 10:03 PM, josef.p...@gmail.com wrote: On Tue, Aug 18, 2009 at 12:59 AM, Maria Liukis wrote: On Aug 17, 2009, at 9:51 PM, Charles

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread Maria Liukis
On Aug 17, 2009, at 10:03 PM, josef.p...@gmail.com wrote: > On Tue, Aug 18, 2009 at 12:59 AM, Maria Liukis wrote: >> >> On Aug 17, 2009, at 9:51 PM, Charles R Harris wrote: >> >> >> On Mon, Aug 17, 2009 at 10:30 PM, Maria Liukis >> wrote: >>> >>> Hello everybody, >>> While re-implementing some

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread josef . pktd
On Tue, Aug 18, 2009 at 1:03 AM, wrote: > On Tue, Aug 18, 2009 at 12:59 AM, Maria Liukis wrote: >> >> On Aug 17, 2009, at 9:51 PM, Charles R Harris wrote: >> >> >> On Mon, Aug 17, 2009 at 10:30 PM, Maria Liukis wrote: >>> >>> Hello everybody, >>> While re-implementing some Matlab code in Python,

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread josef . pktd
On Tue, Aug 18, 2009 at 12:59 AM, Maria Liukis wrote: > > On Aug 17, 2009, at 9:51 PM, Charles R Harris wrote: > > > On Mon, Aug 17, 2009 at 10:30 PM, Maria Liukis wrote: >> >> Hello everybody, >> While re-implementing some Matlab code in Python, I've run into a problem >> of finding a NumPy funct

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread Maria Liukis
On Aug 17, 2009, at 9:51 PM, Charles R Harris wrote: On Mon, Aug 17, 2009 at 10:30 PM, Maria Liukis wrote: Hello everybody, While re-implementing some Matlab code in Python, I've run into a problem of finding a NumPy function analogous to the Matlab's "unique(array, 'rows')" to get uniq

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread Maria Liukis
Josef, Thanks, I'll try that and will search for your question from last december :) Masha liu...@usc.edu On Aug 17, 2009, at 9:44 PM, josef.p...@gmail.com wrote: On Tue, Aug 18, 2009 at 12:30 AM, Maria Liukis wrote: Hello everybody, While re-implementing some Matlab

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread Charles R Harris
On Mon, Aug 17, 2009 at 10:30 PM, Maria Liukis wrote: > Hello everybody, > While re-implementing some Matlab code in Python, I've run into a problem > of finding a NumPy function analogous to the Matlab's "unique(array, > 'rows')" to get unique rows of an array. Searching the web, I've found a >

Re: [Numpy-discussion] unique rows of array

2009-08-17 Thread josef . pktd
On Tue, Aug 18, 2009 at 12:30 AM, Maria Liukis wrote: > Hello everybody, > While re-implementing some Matlab code in Python, I've run into a problem of > finding a NumPy function analogous to the Matlab's "unique(array, 'rows')" > to get unique rows of an array. Searching the web, I've found a simi

[Numpy-discussion] unique rows of array

2009-08-17 Thread Maria Liukis
Hello everybody, While re-implementing some Matlab code in Python, I've run into a problem of finding a NumPy function analogous to the Matlab's "unique (array, 'rows')" to get unique rows of an array. Searching the web, I've found a similar discussion from couple of years ago with an exam

Re: [Numpy-discussion] How to compile numpy without ATLAS support?

2009-08-17 Thread Charles R Harris
On Mon, Aug 17, 2009 at 4:25 PM, Jonathan Taylor < jonathan.tay...@utoronto.ca> wrote: > I am wondering how I might be able to compile numpy without ATLAS on a > ubuntu machine that has an atlas deb installed. It seems that the > numpy build routine automatically detects it. > Try BLAS=None LAP

Re: [Numpy-discussion] Indexing empty array with empty boolean array causes "IndexError: invalid index exception"

2009-08-17 Thread Maria Liukis
On Aug 12, 2009, at 9:25 AM, Robert Kern wrote: > On Mon, Aug 10, 2009 at 14:19, Maria Liukis wrote: >> Hello everybody, >> I'm using following versions of Scipy and Numpy packages: > scipy.__version__ >> '0.7.1' > np.__version__ >> '1.3.0' >> My code uses boolean array to filter 2-dimens

[Numpy-discussion] How to compile numpy without ATLAS support?

2009-08-17 Thread Jonathan Taylor
I am wondering how I might be able to compile numpy without ATLAS on a ubuntu machine that has an atlas deb installed. It seems that the numpy build routine automatically detects it. Thanks for any help, Jonathan. ___ NumPy-Discussion mailing list NumPy

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Keith Goodman
On Mon, Aug 17, 2009 at 2:27 PM, Jonathan Taylor wrote: > It seems to automatically detect it though.  Specifically > lapack_lite.so always seems to reference libatlas. > > On Mon, Aug 17, 2009 at 5:21 PM, Keith Goodman wrote: >> On Mon, Aug 17, 2009 at 2:13 PM, Jonathan >> Taylor wrote: >>> Is the

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Jonathan Taylor
It seems to automatically detect it though. Specifically lapack_lite.so always seems to reference libatlas. On Mon, Aug 17, 2009 at 5:21 PM, Keith Goodman wrote: > On Mon, Aug 17, 2009 at 2:13 PM, Jonathan > Taylor wrote: >> Is there some alternative to get a working numpy going?  How might I >>

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Keith Goodman
On Mon, Aug 17, 2009 at 2:13 PM, Jonathan Taylor wrote: > Is there some alternative to get a working numpy going?  How might I > go about compiling numpy without ATLAS?  I really got to get at least > something working temporarily. Just build numpy again but skip the ATLAS steps. _

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Jonathan Taylor
Yes... ATLAS type problems like matrix multiplication. Is there some alternative to get a working numpy going? How might I go about compiling numpy without ATLAS? I really got to get at least something working temporarily. Thanks, Jon. On Mon, Aug 17, 2009 at 5:03 PM, Keith Goodman wrote: > On

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Keith Goodman
On Mon, Aug 17, 2009 at 1:50 PM, Jonathan Taylor wrote: > I compiled lapack and atlas from scratch using g77 but now > numpy.test() hangs when I try to use any numpy functionality.  I think > I saw someone else write about this.  Is this a common problem? Yes, it seems common. I know of 4 recent A

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Jonathan Taylor
I compiled lapack and atlas from scratch using g77 but now numpy.test() hangs when I try to use any numpy functionality. I think I saw someone else write about this. Is this a common problem? Thanks, Jonathan. On Mon, Aug 17, 2009 at 4:38 PM, Charles R Harris wrote: > > > On Mon, Aug 17, 2009 a

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Charles R Harris
On Mon, Aug 17, 2009 at 1:43 PM, Jonathan Taylor < jonathan.tay...@utoronto.ca> wrote: > Hi, > > I am using a computer that is administered. It is an intel Ubuntu box > and came with an ATLAS compiled. I thus compiled my own numpy1.3.0 > against that ATLAS. > > I was thinking about recompiling A

[Numpy-discussion] ImportError: No module named multiarray

2009-08-17 Thread Reckoner
Hi, I created a pickled file on my Windows PC, uploaded to a Linux machine and then received the following error: Python 2.5.4 (r254:67916, Feb 5 2009, 19:52:35) [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import cP

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Jonathan Taylor
Hi, I am using a computer that is administered. It is an intel Ubuntu box and came with an ATLAS compiled. I thus compiled my own numpy1.3.0 against that ATLAS. I was thinking about recompiling ATLAS myself. This machine only has g77 and not gfortran on it. Will that still work? Thanks, Jona

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Charles R Harris
On Mon, Aug 17, 2009 at 11:42 AM, Jonathan Taylor < jonathan.tay...@utoronto.ca> wrote: > Hi, > > I am getting a strange crash in numpy.linalg.lstsq. I have put the code > that causes the crash along with two data files on my website at: > > http://www.cs.toronto.edu/~jtaylor/crash/

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Matthew Brett
Hi Jonathan, > http://www.cs.toronto.edu/~jtaylor/crash/ > > I would be interested to know if this bug can be duplicated and/or if anyone > has any suggestions as to why: > > import numpy as np > A = np.load('A.npy') > b = np.load('b.npy') > rc = np.linalg.lstsq(A,b) > > produces: > > *** glibc de

Re: [Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread josef . pktd
On Mon, Aug 17, 2009 at 1:42 PM, Jonathan Taylor wrote: > Hi, > > I am getting a strange crash in numpy.linalg.lstsq.  I have put the code > that causes the crash along with two data files on my website at: > > http://www.cs.toronto.edu/~jtaylor/crash/ > > I would be interested to know if this bug

[Numpy-discussion] Strange crash in numpy.linalg.lstsq.

2009-08-17 Thread Jonathan Taylor
Hi, I am getting a strange crash in numpy.linalg.lstsq. I have put the code that causes the crash along with two data files on my website at: http://www.cs.toronto.edu/~jtaylor/crash/ I would be interested to know if this bug can be duplicated and/or if anyone has any suggestions as to why: im

Re: [Numpy-discussion] is there a better way to do this arrayrepeat?

2009-08-17 Thread Chris Colbert
That's exactly it. Thanks! On Mon, Aug 17, 2009 at 5:24 AM, Citi, Luca wrote: > As you stress on "repeat the array ... rather than repeat each element", > you may want to consider tile as well: > np.tile(a, [10,1]) > array([[0, 1, 2], >       [0, 1, 2], >       [0, 1, 2], >       [0, 1, 2], >

Re: [Numpy-discussion] IndexExpression bug?

2009-08-17 Thread Michael McNeil Forbes
Submitted as ticket 1196 http://projects.scipy.org/numpy/ticket/1196 On 5 Jun 2009, at 4:12 PM, Robert Kern wrote: > On Fri, Jun 5, 2009 at 16:14, Michael McNeil Forbes > wrote: >> >>> np.array([0,1,2,3])[1:-1] >> array([1, 2]) >> >> but >> >> >>> np.array([0,1,2,3])[np.s_[1:-1]] >> array([1,

Re: [Numpy-discussion] Specifying Index Programmatically

2009-08-17 Thread Michael McNeil Forbes
There is also numpy.s_: inds = np.s_[...,2,:] z[inds] (Though there are some problems with negative indices: see for example http://www.mail-archive.com/numpy-discussion@scipy.org/msg18245.html) On 8 Aug 2009, at 10:02 PM, T J wrote: > On Sat, Aug 8, 2009 at 8:54 PM, Neil Martinsen-Burrell > w

Re: [Numpy-discussion] memory address of array data?

2009-08-17 Thread Gael Varoquaux
On Sun, Aug 16, 2009 at 11:50:44PM -0700, Stéfan van der Walt wrote: > 2009/8/16 Robert : > > Is there a function to get the memory address (int) of > > (contigious) ndarray data on Python level - like > > array.array.buffer_info() ? > > I'd need it to pass it to a camera function. > Have a look a

Re: [Numpy-discussion] is there a better way to do this arrayrepeat?

2009-08-17 Thread Citi, Luca
As you stress on "repeat the array ... rather than repeat each element", you may want to consider tile as well: >>> np.tile(a, [10,1]) array([[0, 1, 2], [0, 1, 2], [0, 1, 2], [0, 1, 2], [0, 1, 2], [0, 1, 2], [0, 1, 2], [0, 1, 2], [0, 1, 2],