Re: [Numpy-discussion] numpy slices limited to 32 bit values?

2009-05-16 Thread Glenn Tarbox, PhD
Today at Sage Days we tried slices on a few large arrays (no mmap) and found that slicing breaks on arrays somewhere between 2.0e9 and 2.5e9 elements. The failure mode is the same, no error thrown, basically nothing happens This was on one of the big sage machines. I don't know the specific OS / C

Re: [Numpy-discussion] Question about slicing

2009-05-16 Thread Chris Colbert
the reason for all this is that the bitmap image format specifies the image origin as the lower left corner. This is the convention used by PIL. The origin of a numpy array is the upper right corner. Matplot lib does not handle this discrepancy in the function pil_to_array, which is called internal

Re: [Numpy-discussion] Leopard install

2009-05-16 Thread Robert Kern
On Sat, May 16, 2009 at 19:26, ljhardy wrote: > > I'm continuing to have this problem.  I have installed Python 2.6.2 from the > source that is found on www.python.org.  I'm running Leopard 10.5.7. You cannot use a binary of numpy built for Python 2.5 with your Python 2.6. -- Robert Kern "I ha

Re: [Numpy-discussion] Leopard install

2009-05-16 Thread ljhardy
I'm continuing to have this problem. I have installed Python 2.6.2 from the source that is found on www.python.org. I'm running Leopard 10.5.7. Entering "python" from the shell shows: Python 2.6.2 (r262:71600, May 16 2009, 19:04:59) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "

Re: [Numpy-discussion] linear algebra help

2009-05-16 Thread Alan G Isaac
On 5/16/2009 9:01 AM Quilby apparently wrote: > Ax = y > Where A is a rational m*n matrix (m<=n), and x and y are vectors of > the right size. I know A and y, I don't know what x is equal to. I > also know that there is no x where Ax equals exactly y. If m<=n, that can only be true if there are no

Re: [Numpy-discussion] Question about slicing

2009-05-16 Thread Jorge Scandaliaris
Pauli Virtanen iki.fi> writes: > > img = array(img)[::-1] > > Note that here a copy is made. You can use `asarray` instead of `array` > if you want to avoid making a copy. > Thanks, that's good info! > > and it worked!, but I am interested actually in sub-regions of this > > image, so the n

Re: [Numpy-discussion] Question about slicing

2009-05-16 Thread Pauli Virtanen
Sat, 16 May 2009 22:05:16 +, Jorge Scandaliaris wrote: [clip] > I downloaded the scipy logo: > http://docs.scipy.org/doc/_static/scipyshiny_small.png and did the > following: > > img = Image.open('./scipyshiny_small.png') > > mpl.pylab.imshow(img) # Comes upside down > aimg = asarray(img) >

Re: [Numpy-discussion] Question about slicing

2009-05-16 Thread Jorge Scandaliaris
Emmanuelle Gouillart normalesup.org> writes: > > Hi Jorge, > > > roi = aimg[10:20,45:50,:] > > are you working with 3-D images? I didn't know PIL was able to handle 3D > images. > Well, if by 3D you mean color images then yes, PIL is able to handle them > I wasn't able to reproduce the beha

Re: [Numpy-discussion] masked ufuncs in C: on github

2009-05-16 Thread Charles R Harris
On Sat, May 16, 2009 at 2:02 AM, Eric Firing wrote: > Charles R Harris wrote: > > > > > > On Fri, May 15, 2009 at 7:48 PM, Eric Firing > > wrote: > > > > > > http://www.mail-archive.com/numpy-discussion@scipy.org/msg17595.html > > > > Prompted by the thread abo

Re: [Numpy-discussion] Obsolete Endo-generated docs

2009-05-16 Thread Pauli Virtanen
Sat, 16 May 2009 14:02:34 +, Pauli Virtanen wrote: > Hi, > > Sat, 16 May 2009 16:01:00 +0300, Quilby wrote: [clip] >> http://www.scipy.org/doc/numpy_api_docs/numpy.linalg.linalg.html#lstsq > [clip] > > Could we take these old Endo-generated docs down, and make the URL > redirect to docs.scip

[Numpy-discussion] Obsolete Endo-generated docs

2009-05-16 Thread Pauli Virtanen
Hi, Sat, 16 May 2009 16:01:00 +0300, Quilby wrote: [clip] > http://www.scipy.org/doc/numpy_api_docs/numpy.linalg.linalg.html#lstsq [clip] Could we take these old Endo-generated docs down, and make the URL redirect to docs.scipy.org? I believe they are more harmful than helpful... -- Pauli Vir

Re: [Numpy-discussion] linear algebra help

2009-05-16 Thread josef . pktd
On Sat, May 16, 2009 at 9:01 AM, Quilby wrote: > Hi- > This is what I need to do- > > I have this equation- > > Ax = y > > Where A is a rational m*n matrix (m<=n), and x and y are vectors of > the right size. I know A and y, I don't know what x is equal to. I > also know that there is no x where A

Re: [Numpy-discussion] linear algebra help

2009-05-16 Thread Nils Wagner
On Sat, 16 May 2009 16:01:00 +0300 Quilby wrote: > Hi- > This is what I need to do- > > I have this equation- > > Ax = y > > Where A is a rational m*n matrix (m<=n), and x and y are >vectors of > the right size. I know A and y, I don't know what x is >equal to. I > also know that there is n

[Numpy-discussion] linear algebra help

2009-05-16 Thread Quilby
Hi- This is what I need to do- I have this equation- Ax = y Where A is a rational m*n matrix (m<=n), and x and y are vectors of the right size. I know A and y, I don't know what x is equal to. I also know that there is no x where Ax equals exactly y. I want to find the vector x' such that Ax' is

Re: [Numpy-discussion] minimal numpy ?

2009-05-16 Thread Robert
David Cournapeau wrote: Robert wrote: for use in binary distribution where I need only basics and fast startup/low memory footprint, I try to isolate the minimal ndarray type and what I need.. [..] I think you need at least umath to make this work: when doing import numpy.core.multiarray,

Re: [Numpy-discussion] masked ufuncs in C: on github

2009-05-16 Thread David Cournapeau
Eric Firing wrote: > That would incur the overhead of an extra function call for each > element; I suspect it would slow it down a lot. My motivation is to make > masked array overhead negligible, at least for medium to large arrays. > You can use inline in that case - starting with numpy 1.3

Re: [Numpy-discussion] Indexing with callables (was: Yorick-like functionality)

2009-05-16 Thread Pauli Virtanen
Fri, 15 May 2009 16:09:08 -0400, David Huard wrote: > Can this indexing syntax do things that are otherwise awkward with the > current syntax ? Otherwise, I'm not warm to the idea of making indexing > more complex than it is. I think the indexing with callables is more syntax sugar for nested `fun

Re: [Numpy-discussion] Question about slicing

2009-05-16 Thread Pauli Virtanen
Sat, 16 May 2009 08:42:50 +, jorgesmbox-ml wrote: [clip] > I don't feel comfortable working with upside down images, so this had to > be fixed. I tried to be smart and avoid copying the whole image: > > aimg = array(img)[::-1] Note that here a copy is made. You can use `asarray` instead of `ar

Re: [Numpy-discussion] Question about slicing

2009-05-16 Thread Emmanuelle Gouillart
Hi Jorge, > roi = aimg[10:20,45:50,:] are you working with 3-D images? I didn't know PIL was able to handle 3D images. I wasn't able to reproduce the behavior you observed with a simple example: In [20]: base = np.arange(25).reshape((5,5)) In [21]: base Out[21]: array([[ 0, 1, 2, 3, 4],

[Numpy-discussion] Question about slicing

2009-05-16 Thread jorgesmbox-ml
Hi, I am just starting with numpy, pyhton and related others. I work on image processing basically. Now, my question is: what is the expected behaviour when slicing a view of an array? The following example might give some background on what I tried to do and the results obatined (which I don'

Re: [Numpy-discussion] masked ufuncs in C: on github

2009-05-16 Thread Matthieu Brucher
2009/5/16 Robert Kern : > On Sat, May 16, 2009 at 03:02, Eric Firing wrote: >> Charles R Harris wrote: > >>> Here the if ... continue needs to follow the declaration: >>> >>>         if (*mp1) continue; >>>         float in1 = *(float *)ip1; >>>         float in2 = *(float *)ip2; >>>         *(flo

Re: [Numpy-discussion] masked ufuncs in C: on github

2009-05-16 Thread Robert Kern
On Sat, May 16, 2009 at 03:02, Eric Firing wrote: > Charles R Harris wrote: >> Here the if ... continue needs to follow the declaration: >> >>         if (*mp1) continue; >>         float in1 = *(float *)ip1; >>         float in2 = *(float *)ip2; >>         *(float *)op1 = f(in1, in2); >> > > I w

Re: [Numpy-discussion] masked ufuncs in C: on github

2009-05-16 Thread Eric Firing
Charles R Harris wrote: > > > On Fri, May 15, 2009 at 7:48 PM, Eric Firing > wrote: > > > http://www.mail-archive.com/numpy-discussion@scipy.org/msg17595.html > > Prompted by the thread above, I decided to see what it would take to > implement ufuncs wit