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 wrote: > >> Hey, > >> > >> I cooked up an initial implementation for one-dimensional > >> histogram_discrete(). > >>

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

2009-11-12 Thread Anne Archibald
2009/11/11 Christopher Barker : > Anne Archibald wrote: >> 2009/11/10 Christopher Barker : > >>> 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). >> >> This is an eminently reasonab

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 wrote: > David Cournapeau gmail.com> writes: > >> >> On Thu, Nov 12, 2009 at 6:57 AM, Chris 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 tr

Re: [Numpy-discussion] Multiple Regression

2009-11-12 Thread Gökhan Sever
On Thu, Nov 12, 2009 at 9:14 PM, Sturla Molden 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 student mat

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-discussio

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

2009-11-12 Thread Robert Kern
On Thu, Nov 12, 2009 at 20:12, wrote: > On Thu, Nov 12, 2009 at 6:31 PM, Robert Kern wrote: >> On Thu, Nov 12, 2009 at 17:25,   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,

Re: [Numpy-discussion] Multiple Regression

2009-11-12 Thread josef . pktd
On Thu, Nov 12, 2009 at 6:44 PM, Robert Kern wrote: > On Thu, Nov 12, 2009 at 17:38, Alexey Tigarev > wrote: >> Hi All! >> >> I have implemented multiple regression in a following way: >> >> def multipleRegression(x, y): >>    """ Perform linear regression using least squares method. >> >>    X

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

2009-11-12 Thread Christopher Barker
Charles R Harris wrote: > And here is a pep 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/OR&R(206) 526-6959 voice

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 wrote: > On Thu, Nov 12, 2009 at 17:25,   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 say 1dimension. Josef >>> np.bin

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 appe

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

Re: [Numpy-discussion] Multiple Regression

2009-11-12 Thread Robert Kern
On Thu, Nov 12, 2009 at 17:38, Alexey Tigarev 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 - vector conta

[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 """ mulregLogger.de

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

2009-11-12 Thread Robert Kern
On Thu, Nov 12, 2009 at 17:25, 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 to interpret it a

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 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 wrote: >>> Hey, >>> >>> I cooked up an initial implementation for one-dimensional >>> histogram_discrete(). >>> >>> Example: >>>

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 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]) >>

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 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]) >>> numpy.histogram_discre

[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, cri

Re: [Numpy-discussion] Solaris Sparc build broken

2009-11-12 Thread David Cournapeau
On Thu, Nov 12, 2009 at 11:34 PM, Michael Droettboom 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 could declare

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 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 >> >> Ind

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 wrote: > 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 Pyt

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: http://www.scipy.org/Installi

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

2009-11-12 Thread Chris
David Cournapeau gmail.com> writes: > > On Thu, Nov 12, 2009 at 6:57 AM, Chris 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 c

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 sl

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 >

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

2009-11-12 Thread Anne Archibald
2009/11/12 Lou Pecora : > > > - Original Message > From: Christopher Barker > To: Discussion of Numerical Python > 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 seems li

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

2009-11-12 Thread Lou Pecora
- Original Message From: Christopher Barker To: Discussion of Numerical Python 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 seems like over kill. You > might want to try t

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

2009-11-12 Thread Robert Kern
On Thu, Nov 12, 2009 at 11:39, Charles R Harris wrote: > > > On Thu, Nov 12, 2009 at 10:32 AM, Christopher Barker > 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, very common need is >> simply

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 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, very common need is > simply for a growable numpy array. > > It seems this would actually be pretty d

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 comp

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 wrote: > Peter Schmidtke wrote: > > On Tue, 10 Nov 2009 16:07:32 -0800, Christopher Barker > > 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 (

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 Christopher Barker
Peter Schmidtke wrote: > On Tue, 10 Nov 2009 16:07:32 -0800, Christopher Barker > 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 of points? C

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] Import error in builds of 7726

2009-11-12 Thread David Cournapeau
On Thu, Nov 12, 2009 at 6:57 AM, Chris 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 parsing svn st output.

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 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

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-074b9f2bc1bf&displaylang=en Perhaps you can give

Re: [Numpy-discussion] Solaris Sparc build broken

2009-11-12 Thread David Cournapeau
On Thu, Nov 12, 2009 at 12:45 AM, David Cournapeau 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 sign/exp/mantiss

[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 - Proces

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 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 memory foot print

[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