[Numpy-discussion] installating numpy 1.0.1 on AIX 5.3 using python 2.5 and xlf v10.1

2007-02-23 Thread Hans-Joachim Ehlers
Given : AIX 5.3 xlf v10.1 python 2.5 numpy 1.0.1 Task: Building/installaing numpy on AIX 5.3 Problem: The install process can not determine the IBM Fortran compiler Running python ./numpy/distutils/fcompiler/ibm.py gives pretty much garbage on the screen and the resolut is 'None' . So i

Re: [Numpy-discussion] Managing Rolling Data

2007-02-23 Thread Alexander Michael
Timothy's refinement of Anne's idea will work for me: import timeit print '%.2fms/push' % (1000 * timeit.Timer( ...a[...,:-1] = a[...,1:], ...from numpy import empty; a = empty((5000,20,1000)) ...).timeit(number=10)/10) 537.86ms/push I still find the ring buffer solution

[Numpy-discussion] the neighbourhood of each element of an array

2007-02-23 Thread joris
Hi, Given a (possibly masked) 2d array x, is there a fast(er) way in Numpy to obtain the same result as the following few lines? d = 1 # neighbourhood 'radius' Nrow = x.shape[0] Ncol = x.shape[1] y = array([[x[i-d:i+d+1,j-d:j+d+1].ravel() for j in

Re: [Numpy-discussion] Managing Rolling Data

2007-02-23 Thread Anne Archibald
On 23/02/07, Alexander Michael [EMAIL PROTECTED] wrote: I still find the ring buffer solution appealing, but I did not see a way to stack two arrays together without creating copies. Am I missing a bit of numpy cleverness? The short answer is no; the stride in memory from one element to the

Re: [Numpy-discussion] the neighbourhood of each element of an array

2007-02-23 Thread Bryan Cole
On Fri, 2007-02-23 at 17:38 +0100, [EMAIL PROTECTED] wrote: Hi, Given a (possibly masked) 2d array x, is there a fast(er) way in Numpy to obtain the same result as the following few lines? d = 1 # neighbourhood 'radius' Nrow = x.shape[0] Ncol =

Re: [Numpy-discussion] the neighbourhood of each element of an array

2007-02-23 Thread Zachary Pincus
Scipy's ndimage module has a function that takes a generic callback and calls it with the values of each neighborhood (of a given size, and optionally with a particular mask footprint) centered on each array element. That function handles boundary conditions, etc nicely. Unfortunately, I'm

Re: [Numpy-discussion] the neighbourhood of each element of an array

2007-02-23 Thread Pierre GM
On Friday 23 February 2007 14:53:05 Zachary Pincus wrote: Scipy's ndimage module has a function that takes a generic callback and calls it with the values of each neighborhood (of a given size, and optionally with a particular mask footprint) centered on each array element. That function

[Numpy-discussion] Fortran order arrays to and from numpy arrays

2007-02-23 Thread Alexander Schmolck
Hi, I'm currently puzzling over how to best convert (column major order) matlab arrays to numpy arrays and vice versa -- I'm looking for a solution that's simple, general and reasonably fast -- being also applicable to Numeric arrays would be a plus (I'd like to retain Numeric compatibility for

Re: [Numpy-discussion] Fortran order arrays to and from numpy arrays

2007-02-23 Thread Charles R Harris
On 23 Feb 2007 21:19:05 +, Alexander Schmolck [EMAIL PROTECTED] wrote: Hi, I'm currently puzzling over how to best convert (column major order) matlab arrays to numpy arrays and vice versa -- I'm looking for a solution that's simple, general and reasonably fast -- being also applicable to