Re: [Numpy-discussion] Numpy Array of dtype=object with strings and floats question

2009-11-10 Thread Darryl Wallace
Hello again, The best way so far that's come to my attention is to use: numpy.ma.masked_object The problem with this is that it's looking for a specific instance of an object. So if the user had some elements of their array that were, for example, randomString , then it would not be picked up

Re: [Numpy-discussion] Numpy Array of dtype=object with strings and floats question

2009-11-10 Thread Gökhan Sever
On Tue, Nov 10, 2009 at 12:09 PM, Darryl Wallace darryl.wall...@prosensus.ca wrote: Hello again, The best way so far that's come to my attention is to use: numpy.ma.masked_object The problem with this is that it's looking for a specific instance of an object.  So if the user had some elements

Re: [Numpy-discussion] Numpy Array of dtype=object with strings and floats question

2009-11-10 Thread Darryl Wallace
Hello, On Tue, Nov 10, 2009 at 1:32 PM, Gökhan Sever gokhanse...@gmail.com wrote: On Tue, Nov 10, 2009 at 12:09 PM, Darryl Wallace darryl.wall...@prosensus.ca wrote: Hello again, The best way so far that's come to my attention is to use: numpy.ma.masked_object The problem with this is

Re: [Numpy-discussion] Numpy Array of dtype=object with strings and floats question

2009-11-10 Thread Keith Goodman
On Tue, Nov 10, 2009 at 11:14 AM, Keith Goodman kwgood...@gmail.com wrote: On Tue, Nov 10, 2009 at 10:53 AM, Darryl Wallace darryl.wall...@prosensus.ca wrote: I currently do as you suggested.  But when the dataset size becomes large, it gets to be quite slow due to the overhead of python

Re: [Numpy-discussion] Numpy Array of dtype=object with strings and floats question

2009-11-10 Thread Keith Goodman
On Tue, Nov 10, 2009 at 11:28 AM, Keith Goodman kwgood...@gmail.com wrote: On Tue, Nov 10, 2009 at 11:14 AM, Keith Goodman kwgood...@gmail.com wrote: On Tue, Nov 10, 2009 at 10:53 AM, Darryl Wallace darryl.wall...@prosensus.ca wrote: I currently do as you suggested.  But when the dataset size

Re: [Numpy-discussion] Numpy Array of dtype=object with strings and floats question

2009-11-10 Thread Darryl Wallace
Thanks for the help, I'll test out this simple example. On Tue, Nov 10, 2009 at 2:28 PM, Keith Goodman kwgood...@gmail.com wrote: On Tue, Nov 10, 2009 at 11:14 AM, Keith Goodman kwgood...@gmail.com wrote: On Tue, Nov 10, 2009 at 10:53 AM, Darryl Wallace darryl.wall...@prosensus.ca wrote:

Re: [Numpy-discussion] Numpy Array of dtype=object with strings and floats question

2009-11-10 Thread Pierre GM
On Nov 10, 2009, at 1:09 PM, Darryl Wallace wrote: Hello again, The best way so far that's come to my attention is to use: numpy.ma.masked_object Will only work for masking one specific string, as you've noticed. Can anyone help me so that all strings are found in the array without

Re: [Numpy-discussion] Solaris Sparc build broken

2009-11-10 Thread Michael Droettboom
I don't know if your 'long double' detection code is complete yet, but I thought I'd share the current build output on one of our Solaris machines. It looks like it may just be a typo difference between 'IEEE_QUAD_BE' in long_double_representation() and 'IEEE_QUAD_16B_BE' in setup.py, but I

Re: [Numpy-discussion] Numpy Array of dtype=object with strings and floats question

2009-11-10 Thread Darryl Wallace
Hello! On Tue, Nov 10, 2009 at 2:23 PM, Pierre GM pgmdevl...@gmail.com wrote: On Nov 10, 2009, at 1:09 PM, Darryl Wallace wrote: Hello again, The best way so far that's come to my attention is to use: numpy.ma.masked_object Will only work for masking one specific string, as you've

[Numpy-discussion] finding close together points.

2009-11-10 Thread Christopher Barker
Hi all, 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). scipy.spatial.KDTree.query_ball_tree() seems like it's built for this. However, I'm a bit confused. The first argument is a

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

2009-11-10 Thread Anne Archibald
2009/11/10 Christopher Barker chris.bar...@noaa.gov: Hi all, 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 reasonable thing to want, and KDTree should support

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

2009-11-10 Thread James Bergstra
On Tue, Nov 10, 2009 at 7:07 PM, Christopher Barker chris.bar...@noaa.gov wrote: Hi all, 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). scipy.spatial.KDTree.query_ball_tree()

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

2009-11-10 Thread Christopher Barker
James Bergstra wrote: In some cases a brute-force approach is also good. true. If r is a matrix of shape Nx2: (r*r).sum(axis=1) -2 * numpy.dot(r, r.T) + (r*r).sum(axis=1).reshape((r.shape[0], 1)) thresh**2 It's brute force, but it takes advantage of fast matrix multiplication. I'm

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

2009-11-10 Thread James Bergstra
On Tue, Nov 10, 2009 at 8:17 PM, Christopher Barker chris.bar...@noaa.gov wrote: James Bergstra wrote: In some cases a brute-force approach is also good. true. If r is a matrix of shape Nx2: (r*r).sum(axis=1) -2 * numpy.dot(r, r.T) + (r*r).sum(axis=1).reshape((r.shape[0], 1)) thresh**2

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

2009-11-10 Thread David Goldsmith
Also, is it not returning distances between points and themselves? Or am I misinterpreting it? DG On Tue, Nov 10, 2009 at 5:17 PM, Christopher Barker chris.bar...@noaa.govwrote: James Bergstra wrote: In some cases a brute-force approach is also good. true. If r is a matrix of shape

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

2009-11-10 Thread josef . pktd
On Tue, Nov 10, 2009 at 7:48 PM, Anne Archibald peridot.face...@gmail.com wrote: 2009/11/10 Christopher Barker chris.bar...@noaa.gov: Hi all, 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

[Numpy-discussion] Import error in builds of 7726

2009-11-10 Thread Chris
I am building Numpy on OSX 10.6 using a recent update from SVN (r7726). Though I was able to build the package successfully, the resulting package generates an ImportError: import umath ImportError: dlopen(/Library/Python/2.6/site-packages/ numpy-1.4.0.dev7726-py2.6-macosx-10.6-

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

2009-11-10 Thread David Cournapeau
Chris wrote: I am building Numpy on OSX 10.6 using a recent update from SVN (r7726). Though I was able to build the package successfully, the resulting package generates an ImportError: import umath ImportError: dlopen(/Library/Python/2.6/site-packages/

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

2009-11-10 Thread Christopher Barker
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). This is an eminently reasonable thing to want, and

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

2009-11-10 Thread Charles R Harris
On Tue, Nov 10, 2009 at 10:51 PM, Christopher Barker chris.bar...@noaa.govwrote: 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

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

2009-11-10 Thread David Cournapeau
Charles R Harris wrote: I think Python lists are basically just expanding arrays and pointers are cheap. Where you might lose is in creating python objects to put in the list and not having ufuncs and the rest of the numpy machinery. If you don't need the machinery, lists are probably not a

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

2009-11-10 Thread Robert Kern
On Wed, Nov 11, 2009 at 01:15, David Cournapeau da...@ar.media.kyoto-u.ac.jp wrote:    - The Apple Core Foundation (I have to check the Apple license is ok). No. The APSL is not DFSG-free. It is more complex, but is designed with objective-C in mind, meaning integration with the C python

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

2009-11-10 Thread David Cournapeau
Robert Kern wrote: No. The APSL is not DFSG-free. It was too good to be true, I guess. http://c-algorithms.sourceforge.net/ Thanks for the link, David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

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

2009-11-10 Thread Peter Schmidtke
On Tue, 10 Nov 2009 16:07:32 -0800, Christopher Barker chris.bar...@noaa.gov wrote: Hi all, 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?