Re: [Numpy-discussion] 2D (or n-d) fancy indexing?

2008-10-09 Thread Stéfan van der Walt
Hi Zach 2008/10/9 Zachary Pincus [EMAIL PROTECTED]: Conceptually, you need arrays A, B, and C such that composite[x,y] == images[A[x,y], B[x,y], C[x,y]] for all x,y Aha -- thanks especially for the clear illustration of what B and C need to be. That really helps. I also summarised some

Re: [Numpy-discussion] Apply a vector function to each row of a matrix

2008-10-09 Thread Neal Becker
David Huard wrote: Neal, Look at: apply_along_axis I guess it'd be: b = empty_like(a) for row in a.shape[0]: b[row,:] = apply_along_axis (func, row, a) I don't suppose there is a way to do this without explicitly writing a loop. ___

Re: [Numpy-discussion] 2D (or n-d) fancy indexing?

2008-10-09 Thread Zachary Pincus
http://mentat.za.net/numpy/numpy_advanced_slides/ Those slides are really useful! Thanks a ton. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Apply a vector function to each row of a matrix

2008-10-09 Thread David Huard
Neal, Look at: apply_along_axis David On Thu, Oct 9, 2008 at 8:04 AM, Neal Becker [EMAIL PROTECTED] wrote: Suppose I have a function (I wrote in c++) that accepts a numpy 1-d vector. What is the recommended way to apply it to each row of a matrix, returning a new matrix result? (Assume

[Numpy-discussion] dtype behavior

2008-10-09 Thread ctw
Hi -- Can somebody here explain the following behavior: In [1]: tst = np.array([5.]) In [2]: tst Out[2]: array([ 5.]) In [3]: tst.shape Out[3]: (1,) In [4]: tst.dtype Out[4]: dtype('float64') In [5]: tst.dtype = np.int In [6]: tst Out[6]: array([ 0, 1075052544]) In [7]: tst.dtype

Re: [Numpy-discussion] dtype behavior

2008-10-09 Thread Travis E. Oliphant
ctw wrote: Hi -- Can somebody here explain the following behavior: In [1]: tst = np.array([5.]) In [2]: tst Out[2]: array([ 5.]) In [3]: tst.shape Out[3]: (1,) In [4]: tst.dtype Out[4]: dtype('float64') In [5]: tst.dtype = np.int In [6]: tst Out[6]: array([ 0, 1075052544])

[Numpy-discussion] can't build numpy 1.2.0 under python 2.6 (windows-amd64) using VS9

2008-10-09 Thread Paul Lucek
Thanks Hanni! That did it. Numpy builds and installs by commenting out: #ifndef HAVE_FREXPF static float frexpf(float x, int * i) { return (float)frexp((double)(x), i); } #endif #ifndef HAVE_LDEXPF static float ldexpf(float x, int i) { return (float)ldexp((double)(x), i); }

Re: [Numpy-discussion] Apply a vector function to each row of a matrix

2008-10-09 Thread David Huard
On Thu, Oct 9, 2008 at 9:40 AM, Neal Becker [EMAIL PROTECTED] wrote: David Huard wrote: Neal, Look at: apply_along_axis I guess it'd be: b = empty_like(a) for row in a.shape[0]: b[row,:] = apply_along_axis (func, row, a) I don't suppose there is a way to do this without

Re: [Numpy-discussion] OT (NumPy slides)

2008-10-09 Thread Alan G Isaac
http://mentat.za.net/numpy/numpy_advanced_slides/ Zachary Pincus wrote: Those slides are really useful! Thanks a ton. Nice content! And I have to add, S5 produces a beautiful show. Alan Isaac PS What did you use to produce the 3d figures? PPS Do you know why the display get muddled if you

Re: [Numpy-discussion] Apply a vector function to each row of a matrix

2008-10-09 Thread Neal Becker
David Huard wrote: On Thu, Oct 9, 2008 at 9:40 AM, Neal Becker [EMAIL PROTECTED] wrote: David Huard wrote: Neal, Look at: apply_along_axis I guess it'd be: b = empty_like(a) for row in a.shape[0]: b[row,:] = apply_along_axis (func, row, a) I don't suppose there is a way

Re: [Numpy-discussion] OT (NumPy slides)

2008-10-09 Thread Alan G Isaac
http://mentat.za.net/numpy/numpy_advanced_slides/ Alan G Isaac wrote: Do you know why the display get muddled if you switch to full screen on FireFox? I received this reply: Whenever you resize an S5 display (switch to fullscreen or just resize the window), you have to

Re: [Numpy-discussion] Proposal: scipy.spatial

2008-10-09 Thread David Bolme
I have written up basic nearest neighbor algorithm. It does a brute force search so it will be slower than kdtrees as the number of points gets large. It should however work well for high dimensional data. I have also added the option for user defined distance measures. The user can

Re: [Numpy-discussion] can't build numpy 1.2.0 under python 2.6 (windows-amd64) using VS9

2008-10-09 Thread Ravi
On Wednesday 08 October 2008 10:56:02 Hanni Ali wrote: We discussed errors you are encountering a few months ago, they are related to the compiler directives. #ifndef HAVE_FREXPF static float frexpf(float x, int * i) {     return (float)frexp((double)(x), i); } #endif #ifndef

Re: [Numpy-discussion] OT (NumPy slides)

2008-10-09 Thread Stéfan van der Walt
Hi Alan 2008/10/9 Alan G Isaac [EMAIL PROTECTED]: http://mentat.za.net/numpy/numpy_advanced_slides/ Nice content! Thanks! As you can see, I enjoyed myself at SciPy'08 :) And I have to add, S5 produces a beautiful show. This slide show incorporates the changes from S5 Reloaded:

Re: [Numpy-discussion] Please backport fixes to the 1.2.x branch

2008-10-09 Thread Jarrod Millman
On Sun, Oct 5, 2008 at 7:59 PM, Jarrod Millman [EMAIL PROTECTED] wrote: I would like to get a 1.2.1 release out ASAP. There are several bug-fixes on the trunk that need to be backported. If you have made a bug-fix to the trunk that you have been waiting to backport to the 1.2.x branch,

Re: [Numpy-discussion] Please backport fixes to the 1.2.x branch

2008-10-09 Thread Jarrod Millman
I would also like to back port revision 5833: http://projects.scipy.org/scipy/numpy/changeset/5833 Are there any other fixes that should be back ported? -- Jarrod Millman Computational Infrastructure for Research Labs 10 Giannini Hall, UC Berkeley phone: 510.643.4014 http://cirl.berkeley.edu/