Re: [Numpy-discussion] nonuniform scatter operations

2008-09-27 Thread Anne Archibald
2008/9/28 Geoffrey Irving <[EMAIL PROTECTED]>: > Is there an efficient way to implement a nonuniform gather operation > in numpy? Specifically, I want to do something like > > n,m = 100,1000 > X = random.uniform(size=n) > K = random.randint(n, size=m) > Y = random.uniform(size=m) > > for k,y in z

Re: [Numpy-discussion] ANN: NumPy 1.2.0

2008-09-27 Thread David Cournapeau
Thomas Heller wrote: > > No, it isn't complicated. I searched a little about command line options, > and didn't find any. But 7-zip did unpack the installers. I can live with > that. I will look into adding a command line switch. I don't want to add a GUI, but adding some command line switches

Re: [Numpy-discussion] nonuniform scatter operations

2008-09-27 Thread Nathan Bell
On Sun, Sep 28, 2008 at 12:34 AM, Geoffrey Irving <[EMAIL PROTECTED]> wrote: > > Is there an efficient way to implement a nonuniform gather operation > in numpy? Specifically, I want to do something like > > n,m = 100,1000 > X = random.uniform(size=n) > K = random.randint(n, size=m) > Y = random.u

[Numpy-discussion] nonuniform scatter operations

2008-09-27 Thread Geoffrey Irving
Hello, Is there an efficient way to implement a nonuniform gather operation in numpy? Specifically, I want to do something like n,m = 100,1000 X = random.uniform(size=n) K = random.randint(n, size=m) Y = random.uniform(size=m) for k,y in zip(K,Y): X[k] += y but I want it to be fast. The n

Re: [Numpy-discussion] Minimum distance between 2 paths in 3D

2008-09-27 Thread Nathan Bell
On Sat, Sep 27, 2008 at 11:18 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > > I think a kd-tree implementation would be a valuable addition to > scipy, perhaps in a submodule scipy.spatial that might eventually > contain other spatial data structures and algorithms. What do you > think? Should we

Re: [Numpy-discussion] Minimum distance between 2 paths in 3D

2008-09-27 Thread Anne Archibald
2008/9/27 Robert Kern <[EMAIL PROTECTED]>: > On Sat, Sep 27, 2008 at 15:23, Anne Archibald <[EMAIL PROTECTED]> wrote: >> 2008/9/27 Andrea Gavana <[EMAIL PROTECTED]>: >> >>>I was wondering if someone had any suggestions/references/snippets >>> of code on how to find the minimum distance between

Re: [Numpy-discussion] Minimum distance between 2 paths in 3D

2008-09-27 Thread Robert Kern
On Sat, Sep 27, 2008 at 15:23, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/9/27 Andrea Gavana <[EMAIL PROTECTED]>: > >>I was wondering if someone had any suggestions/references/snippets >> of code on how to find the minimum distance between 2 paths in 3D. >> Basically, for every path, I ha

Re: [Numpy-discussion] Minimum distance between 2 paths in 3D

2008-09-27 Thread Andrew Dalke
On Sep 27, 2008, at 10:23 PM, Anne Archibald wrote: > Sadly, no such data structure exists > in either numpy or scipy, though biopython apparently has an > implementation of kd-trees. It's not part of scipy but I saw there was a scikit which supported ANN: http://scipy.org/scipy/scikits/wiki/

Re: [Numpy-discussion] ANN: NumPy 1.2.0

2008-09-27 Thread Thomas Heller
David Cournapeau schrieb: > Thomas Heller wrote: >> >> Well, the first question is: What does happen when I install the SSE3 >> version >> (or how it's called) on my machine, use py2exe to build an app, and this >> app runs on a SSE2 machine - degraded performance, or hard crashes? > > Hard cras

Re: [Numpy-discussion] Minimum distance between 2 paths in 3D

2008-09-27 Thread Anne Archibald
2008/9/27 Andrea Gavana <[EMAIL PROTECTED]>: >I was wondering if someone had any suggestions/references/snippets > of code on how to find the minimum distance between 2 paths in 3D. > Basically, for every path, I have I series of points (x, y, z) and I > would like to know if there is a better

[Numpy-discussion] Cython docs including numpy info

2008-09-27 Thread Fernando Perez
Hi all, I just found out something that might interest others on this list. Gabriel Gellner (forgive me if I'm not duly crediting others, I don't know the detailed history of this) has been leading the effort to produce self-contained Cython documentation, in sphix, that includes the new numpy sup

[Numpy-discussion] Interesting bug with numpy.ma

2008-09-27 Thread Pierre GM
All, I've just been pointed to a strange bug in numpy.ma import numpy as np import numpy.ma as ma assert(ma.masked*float(1) is ma.masked) assert(float(1)*ma.masked is ma.masked) assert(ma.masked*np.float(1) is ma.masked) assert(np.float(1)*ma.masked is ma.masked) assert(ma.masked*np.float_(1) i

Re: [Numpy-discussion] profiling line by line

2008-09-27 Thread Fernando Perez
On Sat, Sep 27, 2008 at 1:31 AM, Robert Kern <[EMAIL PROTECTED]> wrote: >> Mmh, should we ship this out of the box in ipython? The C dependency >> is the only thing that gives me a bit of pause. There goes our pure >> C, easy to build binaries for... On the other hand, me wants :) s/pure C/p

[Numpy-discussion] numpy.random.logseries - incorrect convergence for k=1, k=2

2008-09-27 Thread joep
random numbers generated by numpy.random.logseries do not converge to theoretical distribution: for probability paramater pr = 0.8, the random number generator converges to a frequency for k=1 at 39.8 %, while the theoretical probability mass is 49.71 k=2 is oversampled, other k's look ok check f

Re: [Numpy-discussion] Minimum distance between 2 paths in 3D

2008-09-27 Thread Rob Clewley
Hi Andrea, >I was wondering if someone had any suggestions/references/snippets > of code on how to find the minimum distance between 2 paths in 3D. > Basically, for every path, I have I series of points (x, y, z) and I > would like to know if there is a better way, other than comparing > point

[Numpy-discussion] Minimum distance between 2 paths in 3D

2008-09-27 Thread Andrea Gavana
Hi All, I was wondering if someone had any suggestions/references/snippets of code on how to find the minimum distance between 2 paths in 3D. Basically, for every path, I have I series of points (x, y, z) and I would like to know if there is a better way, other than comparing point by point th

Re: [Numpy-discussion] profiling line by line

2008-09-27 Thread Robert Kern
On Sat, Sep 27, 2008 at 00:50, Fernando Perez <[EMAIL PROTECTED]> wrote: > Hey, > > On Fri, Sep 26, 2008 at 5:36 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > >> There is now! Add >> >>import line_profiler >>ip.expose_magic('lprun', line_profiler.magic_lprun) >> >> to your ipy_user_conf.py .

Re: [Numpy-discussion] ANN: NumPy 1.2.0

2008-09-27 Thread David Cournapeau
Thomas Heller wrote: > > Well, the first question is: What does happen when I install the SSE3 version > (or how it's called) on my machine, use py2exe to build an app, and this > app runs on a SSE2 machine - degraded performance, or hard crashes? Hard crash. That's the whole point of the install

Re: [Numpy-discussion] Bug fix or behavior change?

2008-09-27 Thread Charles R Harris
On Sat, Sep 27, 2008 at 1:18 AM, Charles R Harris <[EMAIL PROTECTED] > wrote: > > > On Sat, Sep 27, 2008 at 12:51 AM, Travis E. Oliphant < > [EMAIL PROTECTED]> wrote: > >> Charles R Harris wrote: >> > Hi All, >> > >> > Currently subtract for boolean arrays is defined in >> > >> > /**begin repeat >

Re: [Numpy-discussion] Bug fix or behavior change?

2008-09-27 Thread Charles R Harris
On Sat, Sep 27, 2008 at 12:51 AM, Travis E. Oliphant <[EMAIL PROTECTED] > wrote: > Charles R Harris wrote: > > Hi All, > > > > Currently subtract for boolean arrays is defined in > > > > /**begin repeat > > * Arithmetic operators > > * > > * # OP = ||, ^, &&# > > * #kind = add, subtract, multi