Re: [Numpy-discussion] array is not writable

2009-08-26 Thread Charles R Harris
On Wed, Aug 26, 2009 at 10:34 PM, David Warde-Farley wrote: > On 26-Aug-09, at 11:49 PM, Mark Wendell wrote: > > > Figured this much out: if I do an np.copy of the original array to a > > new array, then I can edit individual 'color' values with impunity. So > > I guess the original array from the

Re: [Numpy-discussion] array is not writable

2009-08-26 Thread David Warde-Farley
On 26-Aug-09, at 11:49 PM, Mark Wendell wrote: > Figured this much out: if I do an np.copy of the original array to a > new array, then I can edit individual 'color' values with impunity. So > I guess the original array from the pil object still shares memory > with that image object somehow, maki

Re: [Numpy-discussion] array is not writable

2009-08-26 Thread Robert Kern
On Wed, Aug 26, 2009 at 20:49, Mark Wendell wrote: > Figured this much out: if I do an np.copy of the original array to a > new array, then I can edit individual 'color' values with impunity. So > I guess the original array from the pil object still shares memory > with that image object somehow, m

Re: [Numpy-discussion] array is not writable

2009-08-26 Thread Skipper Seabold
On Wed, Aug 26, 2009 at 11:49 PM, Mark Wendell wrote: > Figured this much out: if I do an np.copy of the original array to a > new array, then I can edit individual 'color' values with impunity. So > I guess the original array from the pil object still shares memory > with that image object somehow

Re: [Numpy-discussion] array is not writable

2009-08-26 Thread Mark Wendell
Figured this much out: if I do an np.copy of the original array to a new array, then I can edit individual 'color' values with impunity. So I guess the original array from the pil object still shares memory with that image object somehow, making it unwritable? thanks Mark On Wed, Aug 26, 2009 at

[Numpy-discussion] array is not writable

2009-08-26 Thread Mark Wendell
Hi all - I'm playing with editing image data converted from PIL objects, and running into a situation where numpy tells me that an 'array is not writable'. Not sure I understand what that means, or how to get around it. Here's a sample interactive session: >>> import Image >>> import numpy as np >

Re: [Numpy-discussion] mirr test correctly fails for given input.

2009-08-26 Thread Charles R Harris
Fixes applied in r7324. Thanks guys. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] mirr test correctly fails for given input.

2009-08-26 Thread josef . pktd
On Wed, Aug 26, 2009 at 11:25 AM, wrote: > On Wed, Aug 26, 2009 at 10:08 AM, Skipper Seabold wrote: >> On Wed, Aug 26, 2009 at 1:45 AM, wrote: >>> On Tue, Aug 25, 2009 at 11:38 PM, Charles R >>> Harris wrote: So is it a bug in the test or a bug in the implementation? The problem is that

Re: [Numpy-discussion] mirr test correctly fails for given input.

2009-08-26 Thread josef . pktd
On Wed, Aug 26, 2009 at 10:08 AM, Skipper Seabold wrote: > On Wed, Aug 26, 2009 at 1:45 AM, wrote: >> On Tue, Aug 25, 2009 at 11:38 PM, Charles R >> Harris wrote: >>> So is it a bug in the test or a bug in the implementation? The problem is >>> that the slice values[1:] when >>> values =  [-12

Re: [Numpy-discussion] mirr test correctly fails for given input.

2009-08-26 Thread Skipper Seabold
On Wed, Aug 26, 2009 at 1:45 AM, wrote: > On Tue, Aug 25, 2009 at 11:38 PM, Charles R > Harris wrote: >> So is it a bug in the test or a bug in the implementation? The problem is >> that the slice values[1:] when >> values =  [-12,39000,3,21000,37000,46000] contains no negative >> number a

Re: [Numpy-discussion] filters for rows or columns

2009-08-26 Thread Giuseppe Aprea
On Wed, Aug 26, 2009 at 1:26 AM, Robert Kern wrote: > On Tue, Aug 25, 2009 at 16:18, Giuseppe Aprea wrote: >> Hi,  I would like to do something like this >> >> a=array([[1,2,3,4],[5,6,7,8],[4,5,6,0]]) >> idxList=[] >> for i in range(0,a.shape[1]): >>    if len(nonzero(a[:,i])[0])==1:   #want to ext