Re: [Numpy-discussion] Calculating density based on distance

2012-01-14 Thread Benjamin Root
On Saturday, January 14, 2012, Thiago Franco de Moraes totonixs...@gmail.com wrote: Hi all, I have the following problem: Given a array with dimension Nx3, where N is generally greater than 1.000.000, for each item in this array I have to calculate its density, Where its density is the

Re: [Numpy-discussion] Calculating density based on distance

2012-01-14 Thread Sturla Molden
Den 14.01.2012 21:52, skrev Thiago Franco de Moraes: Is there a better and faster way of doing that? Is there something in my Cython implementation I can do to perform better? You need to use a kd-tree to make the computation run in O(n log n) time instead of O(n**2). scipy.spatial.cKDTree

Re: [Numpy-discussion] Calculating density based on distance

2012-01-14 Thread Thiago Franco Moraes
No dia Sábado, 14 de Janeiro de 2012, Benjamin rootben.r...@ou.edu escreveu: On Saturday, January 14, 2012, Thiago Franco de Moraes totonixs...@gmail.com wrote: Hi all, I have the following problem: Given a array with dimension Nx3, where N is generally greater than 1.000.000, for each