Re: [Numpy-discussion] A faster median (Wirth's method)

2010-11-30 Thread Felix Schlesinger
> > import numpy as np > > cimport numpy as cnp > > > cdef cnp.float64_t namean(cnp.ndarray[cnp.float64_t, ndim=1] a): > >return np.nanmean(a) # just a placeholder > > > is not allowed? It works for me. Is it a cython version thing? > > (I've got 0.13), > > Oh, that's nice! I'm using 0.11.2.

Re: [Numpy-discussion] A faster median (Wirth's method)

2010-11-30 Thread John Salvatier
I think last time I looked into how to apply a function along an axis I thought that the PyArray_IterAllButAxis would not work for that task ( http://docs.scipy.org/doc/numpy/reference/c-api.array.html#PyArray_IterAllButAxis), but I think perhaps I misunderstood it. I'm looking into how to use it.

Re: [Numpy-discussion] Warning: invalid value encountered in subtract

2010-11-30 Thread Pierre GM
On Nov 30, 2010, at 11:22 PM, Keith Goodman wrote: > On Tue, Nov 30, 2010 at 1:41 PM, Skipper Seabold wrote: >> On Tue, Nov 30, 2010 at 1:34 PM, Keith Goodman wrote: >>> After upgrading from numpy 1.4.1 to 1.5.1 I get warnings like >>> "Warning: invalid value encountered in subtract" when I run

Re: [Numpy-discussion] Warning: invalid value encountered in subtract

2010-11-30 Thread Keith Goodman
On Tue, Nov 30, 2010 at 2:25 PM, Robert Kern wrote: > On Tue, Nov 30, 2010 at 16:22, Keith Goodman wrote: >> On Tue, Nov 30, 2010 at 1:41 PM, Skipper Seabold wrote: >>> On Tue, Nov 30, 2010 at 1:34 PM, Keith Goodman wrote: After upgrading from numpy 1.4.1 to 1.5.1 I get warnings like

Re: [Numpy-discussion] Warning: invalid value encountered in subtract

2010-11-30 Thread Robert Kern
On Tue, Nov 30, 2010 at 16:22, Keith Goodman wrote: > On Tue, Nov 30, 2010 at 1:41 PM, Skipper Seabold wrote: >> On Tue, Nov 30, 2010 at 1:34 PM, Keith Goodman wrote: >>> After upgrading from numpy 1.4.1 to 1.5.1 I get warnings like >>> "Warning: invalid value encountered in subtract" when I run

Re: [Numpy-discussion] Warning: invalid value encountered in subtract

2010-11-30 Thread Keith Goodman
On Tue, Nov 30, 2010 at 1:41 PM, Skipper Seabold wrote: > On Tue, Nov 30, 2010 at 1:34 PM, Keith Goodman wrote: >> After upgrading from numpy 1.4.1 to 1.5.1 I get warnings like >> "Warning: invalid value encountered in subtract" when I run unit tests >> (or timeit) using "python -c 'blah'" but no

Re: [Numpy-discussion] Warning: invalid value encountered in subtract

2010-11-30 Thread Skipper Seabold
On Tue, Nov 30, 2010 at 1:34 PM, Keith Goodman wrote: > After upgrading from numpy 1.4.1 to 1.5.1 I get warnings like > "Warning: invalid value encountered in subtract" when I run unit tests > (or timeit) using "python -c 'blah'" but not from an interactive > session. How can I tell the warnings t

Re: [Numpy-discussion] NumPy 1.5.1 on RedHat 5.5

2010-11-30 Thread David Brodbeck
On Tue, Nov 30, 2010 at 11:40 AM, David Brodbeck wrote: > On Tue, Nov 30, 2010 at 9:38 AM, David Brodbeck wrote: > Turns out there is no atlas-devel package, so I changed tactics and > installed blas, blas-devel, lapack, and lapack-devel, instead.  This > was enough to get both NumPy and SciPy bu

Re: [Numpy-discussion] A faster median (Wirth's method)

2010-11-30 Thread Keith Goodman
On Tue, Nov 30, 2010 at 11:58 AM, Matthew Brett wrote: > Hi, > > On Tue, Nov 30, 2010 at 11:35 AM, Keith Goodman wrote: >> On Tue, Nov 30, 2010 at 11:25 AM, John Salvatier >> wrote: >>> I am very interested in this result. I have wanted to know how to do an >> >> My first thought was to write th

Re: [Numpy-discussion] A faster median (Wirth's method)

2010-11-30 Thread Matthew Brett
Hi, On Tue, Nov 30, 2010 at 11:35 AM, Keith Goodman wrote: > On Tue, Nov 30, 2010 at 11:25 AM, John Salvatier > wrote: >> I am very interested in this result. I have wanted to know how to do an > > My first thought was to write the reducing function like this > > cdef np.float64_t namean(np.ndar

Re: [Numpy-discussion] NumPy 1.5.1 on RedHat 5.5

2010-11-30 Thread David Brodbeck
On Tue, Nov 30, 2010 at 9:38 AM, David Brodbeck wrote: > On Mon, Nov 29, 2010 at 9:08 PM, David wrote: >> the *.so.N.M are enough for binaries, but you need the *.so to link >> against a library. Those are generally provided in the -devel RPMS on RH >> distributions, > > Ah, right. Thank you for

Re: [Numpy-discussion] A faster median (Wirth's method)

2010-11-30 Thread Keith Goodman
On Tue, Nov 30, 2010 at 11:25 AM, John Salvatier wrote: > I am very interested in this result. I have wanted to know how to do an My first thought was to write the reducing function like this cdef np.float64_t namean(np.ndarray[np.float64_t, ndim=1] a): but cython doesn't allow np.ndarray in a

Re: [Numpy-discussion] A faster median (Wirth's method)

2010-11-30 Thread John Salvatier
I am very interested in this result. I have wanted to know how to do an apply_along_axis function for a while now. On Tue, Nov 30, 2010 at 11:21 AM, Keith Goodman wrote: > On Tue, Sep 1, 2009 at 2:37 PM, Sturla Molden wrote: > > Dag Sverre Seljebotn skrev: > >> > >> Nitpick: This will fail on l

Re: [Numpy-discussion] A faster median (Wirth's method)

2010-11-30 Thread Keith Goodman
On Tue, Sep 1, 2009 at 2:37 PM, Sturla Molden wrote: > Dag Sverre Seljebotn skrev: >> >> Nitpick: This will fail on large arrays. I guess numpy.npy_intp is the >> right type to use in this case? >> > By the way, here is a more polished version, does it look ok? > > http://projects.scipy.org/numpy/

[Numpy-discussion] Warning: invalid value encountered in subtract

2010-11-30 Thread Keith Goodman
After upgrading from numpy 1.4.1 to 1.5.1 I get warnings like "Warning: invalid value encountered in subtract" when I run unit tests (or timeit) using "python -c 'blah'" but not from an interactive session. How can I tell the warnings to go away? ___ NumP

[Numpy-discussion] subdivide array

2010-11-30 Thread Gerrit Holl
On 30 November 2010 17:58, Pierre GM wrote: > On Nov 30, 2010, at 5:40 PM, John wrote: >> I have an array of data for a global grid at 1 degree resolution. It's >> filled with 1s and 0s, and it is just a land sea mask (not only, but >> as an example). I want to be able to regrid the data to higher

Re: [Numpy-discussion] NumPy 1.5.1 on RedHat 5.5

2010-11-30 Thread David Brodbeck
On Mon, Nov 29, 2010 at 9:08 PM, David wrote: > the *.so.N.M are enough for binaries, but you need the *.so to link > against a library. Those are generally provided in the -devel RPMS on RH > distributions, Ah, right. Thank you for filling in that missing piece of information for me. I'll see i

Re: [Numpy-discussion] subdivide array

2010-11-30 Thread Pierre GM
On Nov 30, 2010, at 5:40 PM, John wrote: > Hello, > > I have an array of data for a global grid at 1 degree resolution. It's > filled with 1s and 0s, and it is just a land sea mask (not only, but > as an example). I want to be able to regrid the data to higher or > lower resolutions (i.e. 0.5 or

Re: [Numpy-discussion] subdivide array

2010-11-30 Thread Whitcomb, Mr. Tim
> I have an array of data for a global grid at 1 degree resolution. It's > filled with 1s and 0s, and it is just a land sea mask (not only, but > as an example). I want to be able to regrid the data to higher or > lower resolutions (i.e. 0.5 or 2 degrees). But if I try to use any > standard interp

[Numpy-discussion] subdivide array

2010-11-30 Thread John
Hello, I have an array of data for a global grid at 1 degree resolution. It's filled with 1s and 0s, and it is just a land sea mask (not only, but as an example). I want to be able to regrid the data to higher or lower resolutions (i.e. 0.5 or 2 degrees). But if I try to use any standard interp fu