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.random.randint(0,

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

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

[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

Re: [Numpy-discussion] slicing and aliasing

2012-05-31 Thread Keith Goodman
On Thu, May 31, 2012 at 7:30 AM, Neal Becker ndbeck...@gmail.com 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: