Re: [Numpy-discussion] slicing and aliasing

2012-05-31 Thread Keith Goodman
On Thu, May 31, 2012 at 7:30 AM, Neal Becker wrote: > That is, will: > > u[a:b] = u[c:d] > > always work (assuming the ranges of a:b, d:d are equal, or course) It works most of the time. This thread shows you how to find an example where it does not work: http://mail.scipy.org/pipermail/numpy-d

[Numpy-discussion] slicing and aliasing

2012-05-31 Thread Neal Becker
Will copying slices always work correctly w/r to aliasing? That is, will: u[a:b] = u[c:d] always work (assuming the ranges of a:b, d:d are equal, or course) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/lis

Re: [Numpy-discussion] fast access and normalizing of ndarray slices

2012-05-31 Thread Val Kalatsky
Hi Wolfgang, I thought maybe there is a trick for your specific operation. Your array stacking is a simple case of the group-by operation and normalization is aggregation followed by update. I believe group-by and aggregation are on the NumPy todo-list. You may have to write a small extension modu

Re: [Numpy-discussion] fast access and normalizing of ndarray slices

2012-05-31 Thread Wolfgang Kerzendorf
Hey Val, Well it doesn't matter what I do, but specifically I do factor = sum(data_array[start_point:start_point+length_data]) and then data[array[start_point:start_point+length_data]) /= factor. and that for every star_point and length data. How to do this fast? Cheers Wolfgang On 2012-05-

Re: [Numpy-discussion] Bus error when using flat on sliced, memmap'd array

2012-05-31 Thread Travis Oliphant
Be sure to file a ticket... -Travis On May 30, 2012, at 9:05 PM, chris farrow wrote: > Hi all, > > I encountered an odd bug today that I wanted to bring to everyone's > attention. First the code: > > >>> import numpy as np > >>> shape = (8, 8) > >>> dtype = np.dtype(np.uint8) > >>> image = np