Re: [Numpy-discussion] Decision tree-like algorithm on numpy arrays

2010-05-06 Thread Martin Raspaud
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Francesc Alted skrev: > Hi Martin, [...] > > and the output for my machine: > > result_array1: [4 2 4 ..., 1 3 4] 1.819 > result_array2: [4 2 4 ..., 1 3 4] 0.308 > > which is a 6x speed-up. I suppose this should be pretty close of what you > can

Re: [Numpy-discussion] Brooken Toolchain (Mac 10.6)

2010-05-06 Thread Ralf Gommers
On Fri, May 7, 2010 at 1:47 PM, Patrick Marsh wrote: > I don't have that directory on my machine, so I'm trying to track down my > OSX 10.4 install disc to see if I can reinstall it. Thanks for the > suggestion; I'll let you know tomorrow what happens. > You don't need the 10.4 disc, the 10.4 SD

Re: [Numpy-discussion] Brooken Toolchain (Mac 10.6)

2010-05-06 Thread Patrick Marsh
I don't have that directory on my machine, so I'm trying to track down my OSX 10.4 install disc to see if I can reinstall it. Thanks for the suggestion; I'll let you know tomorrow what happens. Patrick On Thu, May 6, 2010 at 10:44 AM, Ralf Gommers wrote: > > > On Thu, May 6, 2010 at 11:21 AM, P

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread Charles R Harris
On Thu, May 6, 2010 at 11:25 AM, T J wrote: > Hi, > > Is there a way to sort the columns in an array? I need to sort it so > that I can easily go through and keep only the unique columns. > ndarray.sort(axis=1) doesn't do what I want as it destroys the > relative ordering between the various col

[Numpy-discussion] saving object array to ascii file

2010-05-06 Thread Maria Liukis
Hello Everybody, Sorry if it's a trivial question. I'm trying to find out if there is a way to save object array to ascii file. numpy.savetxt() in NumPy V1.3.0 doesn't seem to work: >>> import numpy as np >>> obj_arr = np.zeros((2,), dtype=np.object) >>> obj_arr[0] = np.array([[1,2,3], [4,5,6],

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread josef . pktd
On Thu, May 6, 2010 at 4:45 PM, T J wrote: > On Thu, May 6, 2010 at 10:36 AM,   wrote: >> >> there is a thread last august on unique rows which might be useful, >> and a thread in Dec 2008 for sorting rows >> >> something like >> >> np.unique1d(c.view([('',c.dtype)]*c.shape[1])).view(c.dtype).resh

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread T J
On Thu, May 6, 2010 at 10:36 AM, wrote: > > there is a thread last august on unique rows which might be useful, > and a thread in Dec 2008 for sorting rows > > something like > > np.unique1d(c.view([('',c.dtype)]*c.shape[1])).view(c.dtype).reshape(-1,c.shape[1]) > > maybe it's np.unique with nump

[Numpy-discussion] trouble with bool_

2010-05-06 Thread Alan G Isaac
What information exactly is `isnan` supposed to communicate? Put another way, given that it raises NotImplemented for unknown types, and that bool(NotImplemented) is True, is there a reason by it cannot return a Python bool (which seems more useful)? Thanks, Alan Isaac > >> np.isnan(np.nan) True

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread T J
On Thu, May 6, 2010 at 10:34 AM, Keith Goodman wrote: > On Thu, May 6, 2010 at 10:25 AM, T J wrote: >> Hi, >> >> Is there a way to sort the columns in an array?  I need to sort it so >> that I can easily go through and keep only the unique columns. >> ndarray.sort(axis=1) doesn't do what I want a

[Numpy-discussion] SciPy 2010: Bioinformatic & Parallel/cloud talks announced...& register now!

2010-05-06 Thread Amenity Applewhite
Hello! Things are moving quickly in preparation for SciPy 2010: Last week we announced the General Conference schedule (http://conference.scipy.org/scipy2010/schedule.html ), Tuesday we announced our student sponsorship recipients (http://conference.scipy.org/scipy2010/student.html ) and now

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread josef . pktd
On Thu, May 6, 2010 at 1:25 PM, T J wrote: > Hi, > > Is there a way to sort the columns in an array?  I need to sort it so > that I can easily go through and keep only the unique columns. > ndarray.sort(axis=1) doesn't do what I want as it destroys the > relative ordering between the various colum

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread Keith Goodman
On Thu, May 6, 2010 at 10:25 AM, T J wrote: > Hi, > > Is there a way to sort the columns in an array?  I need to sort it so > that I can easily go through and keep only the unique columns. > ndarray.sort(axis=1) doesn't do what I want as it destroys the > relative ordering between the various colu

[Numpy-discussion] Remove duplicate columns

2010-05-06 Thread T J
Hi, Is there a way to sort the columns in an array? I need to sort it so that I can easily go through and keep only the unique columns. ndarray.sort(axis=1) doesn't do what I want as it destroys the relative ordering between the various columns. For example, I would like: [[2,1,3], [3,5,1], [0

Re: [Numpy-discussion] Brooken Toolchain (Mac 10.6)

2010-05-06 Thread Ralf Gommers
On Thu, May 6, 2010 at 11:21 AM, Patrick Marsh wrote: > I apologize for not following up on this thread right away. I was sick for > a couple of days and then there were several major severe weather outbreaks > that required me to spend more time at work. With this said, I've resumed > trying to

Re: [Numpy-discussion] Decision tree-like algorithm on numpy arrays

2010-05-06 Thread Francesc Alted
Hi Martin, A Thursday 06 May 2010 08:50:33 Martin Raspaud escrigué: > Hi all, > > I have an old c-extension I want to remove from my code to the benefit of > numpy, but it looks kind of tricky to me. > > Here is the thing: > I have a number of arrays of the same shape. > On these arrays, I run

Re: [Numpy-discussion] PY_ARRAY_UNIQUE_SYMBOL is too far reaching?

2010-05-06 Thread Charles R Harris
On Thu, May 6, 2010 at 3:08 AM, Austin Bingham wrote: > >> they'd likely crash. > > > > Really? > > I base that on the assumption that they'd not know to call > import_array() in that translation unit. This seems like a reasonable > assumption because, by defining the macros as such, they are stro

Re: [Numpy-discussion] PY_ARRAY_UNIQUE_SYMBOL is too far reaching?

2010-05-06 Thread Charles R Harris
On Thu, May 6, 2010 at 8:21 AM, Charles R Harris wrote: > > > On Thu, May 6, 2010 at 3:08 AM, Austin Bingham > wrote: > >> >> they'd likely crash. >> > >> > Really? >> >> I base that on the assumption that they'd not know to call >> import_array() in that translation unit. This seems like a reaso

Re: [Numpy-discussion] PY_ARRAY_UNIQUE_SYMBOL is too far reaching?

2010-05-06 Thread Austin Bingham
>> they'd likely crash. > > Really? I base that on the assumption that they'd not know to call import_array() in that translation unit. This seems like a reasonable assumption because, by defining the macros as such, they are strongly implying that they expect the API functions to be imported for

Re: [Numpy-discussion] PY_ARRAY_UNIQUE_SYMBOL is too far reaching?

2010-05-06 Thread Hans Meine
Am Donnerstag 06 Mai 2010 08:10:35 schrieb Austin Bingham: > Suppose I defined neither macro in my 'util.h', and that I included > 'arrayobject.h'. If a user of my library did this: > > #include // <-- my library's header > > #define PY_ARRAY_UNIQUE_SYMBOL MY_UNIQUE_SYMBOL > #define NO_IMP

[Numpy-discussion] Decision tree-like algorithm on numpy arrays

2010-05-06 Thread Martin Raspaud
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I have an old c-extension I want to remove from my code to the benefit of numpy, but it looks kind of tricky to me. Here is the thing: I have a number of arrays of the same shape. On these arrays, I run a sequence of tests, leading to a kind