[Numpy-discussion] does an ndarray have a hook for a dictionary attribute ?

2009-11-12 Thread Sebastian Haase
Hi, I hope my subject line is not entirely incomprehensible: I remember there was a discussion (some time ago) that every ndarray instance should get an extra dictionary (or just a hook for it, to minimize the memory foot print) for application specific / auxiliary data. What is the current state

Re: [Numpy-discussion] does an ndarray have a hook for a dictionary attribute ?

2009-11-12 Thread Sebastian Haase
On Thu, Nov 12, 2009 at 10:38 AM, Sebastian Haase seb.ha...@gmail.com wrote: Hi, I hope my subject line is not entirely incomprehensible: I remember there was a discussion (some time ago) that every ndarray instance should get an extra dictionary (or just a hook for it, to minimize the

[Numpy-discussion] Failed installation on Windows XP

2009-11-12 Thread José María García Pérez
Good morning, I used to have Python 2.6, Numpy-1.3.0, ... on Windows 2000 in the computer at work (which has the typical clampdown policies). I have been updated to Windows XP SP3 and now the same installation files fail to install. My configuration is: - Windows XP Serivice Pack 3 -

Re: [Numpy-discussion] Solaris Sparc build broken

2009-11-12 Thread David Cournapeau
On Thu, Nov 12, 2009 at 12:45 AM, David Cournapeau courn...@gmail.com wrote: I will implement this, but I would prefer using this method everywhere for every compiler, it would be more robust. Done for r7727. I have not tested it much (I have only checked that the bit twiddling macros to get

Re: [Numpy-discussion] Failed installation on Windows XP

2009-11-12 Thread V. Armando Solé
Hola, I am not an expert, but I had a similar issue with a program of main that I could trace to not having installed VS9 runtime libraries in the target computer: http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bfdisplaylang=en Perhaps you can give

Re: [Numpy-discussion] does an ndarray have a hook for a dictionary attribute ?

2009-11-12 Thread Pierre GM
On Nov 12, 2009, at 4:47 AM, Sebastian Haase wrote: On Thu, Nov 12, 2009 at 10:38 AM, Sebastian Haase seb.ha...@gmail.com wrote: Hi, I hope my subject line is not entirely incomprehensible: I remember there was a discussion (some time ago) that every ndarray instance should get an extra

Re: [Numpy-discussion] Import error in builds of 7726

2009-11-12 Thread David Cournapeau
On Thu, Nov 12, 2009 at 6:57 AM, Chris fonnesb...@gmail.com wrote: Yeah, here is my build script -- it removes the build directory entirely Ah, that's not enough. You need to clean the working tree as well. git has the clean option for that, you can also use a quick script to do this with

Re: [Numpy-discussion] Solaris Sparc build broken

2009-11-12 Thread Michael Droettboom
The new macros contain non-constant initializers for a type declared constant. const union IEEEl2bitsrep u = {x}; AFAIK, ANSI dictates that the initializer must be a literal or another constant variable. We could declare 'x' as constant in the function signature, but it actually does get

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Christopher Barker
Peter Schmidtke wrote: On Tue, 10 Nov 2009 16:07:32 -0800, Christopher Barker chris.bar...@noaa.gov wrote: I have a bunch of points in 2-d space, and I need to find out which pairs of points are within a certain distance of one-another (regular old Euclidean norm). How big is your set

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Christopher Barker
David Cournapeau wrote: I would love having a core C library of containers - I'm all for that. However, I think that a very, very common need is simply for a growable numpy array. It seems this would actually be pretty darn easy (again, for someone familiar with the code!). IIUC, it would

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Charles R Harris
On Thu, Nov 12, 2009 at 10:01 AM, Christopher Barker chris.bar...@noaa.govwrote: Peter Schmidtke wrote: On Tue, 10 Nov 2009 16:07:32 -0800, Christopher Barker chris.bar...@noaa.gov wrote: I have a bunch of points in 2-d space, and I need to find out which pairs of points are within a

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Christopher Barker
Lou Pecora wrote: Maybe I'm missing something simple, but if your array of 2D points is static, well, not quite. a KD tree for 2D nearest neighbor seems like over kill. You might want to try the simple approach of using boxes of points to narrow things down by sorting on the first

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Charles R Harris
On Thu, Nov 12, 2009 at 10:32 AM, Christopher Barker chris.bar...@noaa.govwrote: David Cournapeau wrote: I would love having a core C library of containers - I'm all for that. However, I think that a very, very common need is simply for a growable numpy array. It seems this would

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Robert Kern
On Thu, Nov 12, 2009 at 11:39, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Nov 12, 2009 at 10:32 AM, Christopher Barker chris.bar...@noaa.gov wrote: David Cournapeau wrote: I would love having a core C library of containers - I'm all for that. However, I think that a very,

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Lou Pecora
- Original Message From: Christopher Barker chris.bar...@noaa.gov To: Discussion of Numerical Python numpy-discussion@scipy.org Sent: Thu, November 12, 2009 12:37:37 PM Subject: Re: [Numpy-discussion] finding close together points. Lou Pecora wrote: a KD tree for 2D nearest neighbor

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Anne Archibald
2009/11/12 Lou Pecora lou_boog2...@yahoo.com: - Original Message From: Christopher Barker chris.bar...@noaa.gov To: Discussion of Numerical Python numpy-discussion@scipy.org Sent: Thu, November 12, 2009 12:37:37 PM Subject: Re: [Numpy-discussion] finding close together points.

Re: [Numpy-discussion] NumPy-Discussion Digest, Vol 38, Issue 52

2009-11-12 Thread Jake VanderPlas
I'm rapidly losing interest here. Perhaps you could supply some code implementing this new array? Why not just a class using an array that doubles the array size when an index is out of bounds and copies over the old data. That is pretty much what realloc does. As to python lists, do you have

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Christopher Barker
Robert Kern wrote: Didn't we already do this? http://www.mail-archive.com/numpy-discussion@scipy.org/msg21010.html Indeed we did. What I posted then ( and have improved a bit now). Is a Python version. Written in Python, it has an advantage of using less memory for a big array, but is

Re: [Numpy-discussion] Import error in builds of 7726

2009-11-12 Thread Chris
David Cournapeau cournape at gmail.com writes: On Thu, Nov 12, 2009 at 6:57 AM, Chris fonnesbeck at gmail.com wrote: Yeah, here is my build script -- it removes the build directory entirely Ah, that's not enough. You need to clean the working tree as well. git has the clean option

Re: [Numpy-discussion] Failed installation on Windows XP

2009-11-12 Thread José María García Pérez
Thanks for your answer, but it didn't resolve the issue. The problem is that I would need an administrator account to install it. Nevertheless, your suggestion might be helpful to others. I am not an expert either, but it looks like a dependency problem. Reading from:

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Charles R Harris
On Thu, Nov 12, 2009 at 12:52 PM, Christopher Barker chris.bar...@noaa.govwrote: Robert Kern wrote: Didn't we already do this? http://www.mail-archive.com/numpy-discussion@scipy.org/msg21010.html Indeed we did. What I posted then ( and have improved a bit now). Is a Python version.

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Charles R Harris
On Thu, Nov 12, 2009 at 3:30 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Nov 12, 2009 at 12:52 PM, Christopher Barker chris.bar...@noaa.gov wrote: Robert Kern wrote: Didn't we already do this? http://www.mail-archive.com/numpy-discussion@scipy.org/msg21010.html

Re: [Numpy-discussion] Solaris Sparc build broken

2009-11-12 Thread David Cournapeau
On Thu, Nov 12, 2009 at 11:34 PM, Michael Droettboom md...@stsci.edu wrote: The new macros contain non-constant initializers for a type declared constant.    const union IEEEl2bitsrep u = {x}; AFAIK, ANSI dictates that the initializer must be a literal or another constant variable.  We

[Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread Priit Laes
Hey, I cooked up an initial implementation for one-dimensional histogram_discrete(). Example: import numpy numpy.histogram_discrete([-1, 9, 9, 0, 3, 5, 3]) array([1, 1, 0, 0, 2, 0, 1, 0, 0, 0, 2]) numpy.histogram_discrete([-9, 9]) array([1, 0, 0, ..., 0, 0, 1]) Suggestions,

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread josef . pktd
On Thu, Nov 12, 2009 at 6:00 PM, Priit Laes pl...@plaes.org wrote: Hey, I cooked up an initial implementation for one-dimensional histogram_discrete(). Example: import numpy numpy.histogram_discrete([-1, 9, 9, 0, 3, 5, 3]) array([1, 1, 0, 0, 2, 0, 1, 0, 0, 0, 2])

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread David Warde-Farley
On 12-Nov-09, at 6:09 PM, josef.p...@gmail.com wrote: On Thu, Nov 12, 2009 at 6:00 PM, Priit Laes pl...@plaes.org wrote: Hey, I cooked up an initial implementation for one-dimensional histogram_discrete(). Example: import numpy numpy.histogram_discrete([-1, 9, 9, 0, 3, 5, 3]) array([1,

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread josef . pktd
On Thu, Nov 12, 2009 at 6:16 PM, David Warde-Farley d...@cs.toronto.edu wrote: On 12-Nov-09, at 6:09 PM, josef.p...@gmail.com wrote: On Thu, Nov 12, 2009 at 6:00 PM, Priit Laes pl...@plaes.org wrote: Hey, I cooked up an initial implementation for one-dimensional histogram_discrete().

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread Robert Kern
On Thu, Nov 12, 2009 at 17:25, josef.p...@gmail.com wrote: If I could make a related wish, I wish np.bincount to take also a 2d array as weights. It does. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt

[Numpy-discussion] Multiple Regression

2009-11-12 Thread Alexey Tigarev
Hi All! I have implemented multiple regression in a following way: def multipleRegression(x, y): Perform linear regression using least squares method. X - matrix containing inputs for observations, y - vector containing one of outputs for every observation

Re: [Numpy-discussion] Multiple Regression

2009-11-12 Thread David Warde-Farley
On 12-Nov-09, at 6:44 PM, Robert Kern wrote: I am using it on large number of observations so it is common to have x matrix of about 5000x20 and y vector of length 5000, and more. I also have to run that multiple times for different y vectors and same x matrix. Just make a matrix y such

Re: [Numpy-discussion] Multiple Regression

2009-11-12 Thread Robert Kern
On Thu, Nov 12, 2009 at 17:38, Alexey Tigarev alexey.tiga...@gmail.com wrote: Hi All! I have implemented multiple regression in a following way: def multipleRegression(x, y):     Perform linear regression using least squares method.    X - matrix containing inputs for observations,    y -

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Christopher Barker
Charles R Harris wrote: So what you buy with an array implementation is the space/time efficiency of not having to allocate python types to put on the list. But you probably need to go through a python type at some point anyway, When writing Python, yes (though maybe not if you are

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread josef . pktd
On Thu, Nov 12, 2009 at 6:31 PM, Robert Kern robert.k...@gmail.com wrote: On Thu, Nov 12, 2009 at 17:25,  josef.p...@gmail.com wrote: If I could make a related wish, I wish np.bincount to take also a 2d array as weights. It does. If it does, I don't manage to make it work, and the new docs

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Christopher Barker
Charles R Harris wrote: And here is a pep http://www.python.org/dev/peps/pep-3128/%20 That link was broken, try this one: http://www.python.org/dev/peps/pep-3128/ -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice

Re: [Numpy-discussion] Multiple Regression

2009-11-12 Thread josef . pktd
On Thu, Nov 12, 2009 at 6:44 PM, Robert Kern robert.k...@gmail.com wrote: On Thu, Nov 12, 2009 at 17:38, Alexey Tigarev alexey.tiga...@gmail.com wrote: Hi All! I have implemented multiple regression in a following way: def multipleRegression(x, y):     Perform linear regression using

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread Robert Kern
On Thu, Nov 12, 2009 at 20:12, josef.p...@gmail.com wrote: On Thu, Nov 12, 2009 at 6:31 PM, Robert Kern robert.k...@gmail.com wrote: On Thu, Nov 12, 2009 at 17:25,  josef.p...@gmail.com wrote: If I could make a related wish, I wish np.bincount to take also a 2d array as weights. It does.

Re: [Numpy-discussion] Multiple Regression

2009-11-12 Thread Sturla Molden
Alexey Tigarev skrev: I have implemented multiple regression in a following way: You should be using QR or SVD for this. Sturla ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Multiple Regression

2009-11-12 Thread Gökhan Sever
On Thu, Nov 12, 2009 at 9:14 PM, Sturla Molden stu...@molden.no wrote: Alexey Tigarev skrev: I have implemented multiple regression in a following way: You should be using QR or SVD for this. Sturla Seeing this QR and SVD terms I recalled the answer to the I am the very model for a

Re: [Numpy-discussion] Import error in builds of 7726

2009-11-12 Thread David Cournapeau
On Fri, Nov 13, 2009 at 4:56 AM, Chris fonnesb...@gmail.com wrote: David Cournapeau cournape at gmail.com writes: On Thu, Nov 12, 2009 at 6:57 AM, Chris fonnesbeck at gmail.com wrote: Yeah, here is my build script -- it removes the build directory entirely Ah, that's not enough. You

Re: [Numpy-discussion] finding close together points.

2009-11-12 Thread Anne Archibald
2009/11/11 Christopher Barker chris.bar...@noaa.gov: Anne Archibald wrote: 2009/11/10 Christopher Barker chris.bar...@noaa.gov: I have a bunch of points in 2-d space, and I need to find out which pairs of points are within a certain distance of one-another (regular old Euclidean norm).

Re: [Numpy-discussion] Initial implementation of histogram_discrete()

2009-11-12 Thread Priit Laes
Ühel kenal päeval, N, 2009-11-12 kell 18:16, kirjutas David Warde-Farley: On 12-Nov-09, at 6:09 PM, josef.p...@gmail.com wrote: On Thu, Nov 12, 2009 at 6:00 PM, Priit Laes pl...@plaes.org wrote: Hey, I cooked up an initial implementation for one-dimensional histogram_discrete().