Re: [Numpy-discussion] Inverting argsort(a, axis=0) to obtain column-wise ranks

2010-09-19 Thread John Schulman
D'oh, Zachary already gave that answer. On Sun, Sep 19, 2010 at 10:17 PM, John Schulman wrote: > Argsort twice and you get the rank. > > a1.argsort(axis=0).argsort(axis=0) > > That's because argsort is it's own inverse when applied to the ranks. > > On Tu

Re: [Numpy-discussion] Inverting argsort(a, axis=0) to obtain column-wise ranks

2010-09-19 Thread John Schulman
Argsort twice and you get the rank. a1.argsort(axis=0).argsort(axis=0) That's because argsort is it's own inverse when applied to the ranks. On Tue, Sep 7, 2010 at 1:01 PM, Alexander Michael wrote: > Calculating ranks by inverting the results of an argsort is > straightforward and fast for 1D a

[Numpy-discussion] Infix operators for numpy arrays

2010-04-18 Thread John Schulman
Hi all, I just posted a recipe (http://code.activestate.com/recipes/577201/) for infix operators that work with numpy arrays, so you can write X *dot* Y. It works by making the Infix class a subclass of ndarray. John ___ NumPy-Discussion mailing list Num

[Numpy-discussion] Scipy09 Sprints

2009-08-22 Thread John Schulman
For the numpy/scipyers at Caltech now: I'm wondering what is happening with the scipy09 sprints. According to the website, the sprints start at 8AM in Powell Booth, but that building is locked and there's no sign of life. Best, John ___ NumPy-Discussion m

[Numpy-discussion] switching to float32

2009-06-25 Thread John Schulman
I'm trying to reduce the memory used in a calculation, so I'd like to switch my program to float32 instead of float64. Is it possible to change the numpy default float size, so I don't have to explicitly state dtype=np.float32 everywhere? Thanks, John __

Re: [Numpy-discussion] error with large memmap

2009-06-09 Thread John Schulman
What's the best way to install a 64-bit python alongside my existing installation? On Tue, Jun 9, 2009 at 7:32 AM, John Schulman wrote: > OK looks like that was the issue > $ python -c "import platform; print platform.machine()" > i386 > > Thanks > > >

Re: [Numpy-discussion] error with large memmap

2009-06-09 Thread John Schulman
OK looks like that was the issue $ python -c "import platform; print platform.machine()" i386 Thanks On Tue, Jun 9, 2009 at 2:52 AM, David Cournapeau wrote: > Charles R Harris wrote: >> >> >> On Tue, Jun 9, 2009 at 2:32 AM, John Schulman > <mailto:jos.

[Numpy-discussion] error with large memmap

2009-06-09 Thread John Schulman
I'm getting the error OverflowError: cannot fit 'long' into an index-sized integer when I try to memmap a 6gb file top of the stack trace is mm = mmap.mmap(fid.fileno(), bytes, access=acc) where bytes = 652800L I thought that 64-bit systems with python>2.5 could memmap large files. I'm runnin