Re: [Numpy-discussion] New functions added in pull request

2015-11-26 Thread Benjamin Root
Oooh, this will be nice to have. This would be one of the few times I would love to see unicode versions of these function names supplied, too. On Wed, Nov 25, 2015 at 5:31 PM, Antonio Lara wrote: > Hello, I have added three new functions to the file function_base.py in >

[Numpy-discussion] New functions added in pull request

2015-11-25 Thread Antonio Lara
Hello, I have added three new functions to the file function_base.py in the numpy/lib folder. These are divergence, curl and laplacian (for the moment, laplacian of a scalar field, maybe in the future I will try laplacian for a vector field). The calculation method is based in the existing one for

Re: [Numpy-discussion] New functions.

2011-06-02 Thread josef . pktd
On Wed, Jun 1, 2011 at 9:35 PM, David Cournapeau courn...@gmail.com wrote: On Thu, Jun 2, 2011 at 1:49 AM, Mark Miller markperrymil...@gmail.com wrote: Not quite. Bincount is fine if you have a set of approximately sequential numbers. But if you don't Even worse, it fails miserably if you

Re: [Numpy-discussion] New functions.

2011-06-02 Thread Robert Kern
On Wed, Jun 1, 2011 at 22:06, Travis Oliphant oliph...@enthought.com wrote: On May 31, 2011, at 8:08 PM, Charles R Harris wrote: 2) Ufunc fadd (nanadd?) Treats nan as zero in addition. Should make a faster version of nansum possible. +0  --- Some discussion at the data array summit led to

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Keith Goodman
On Tue, May 31, 2011 at 8:41 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, May 31, 2011 at 8:50 PM, Bruce Southey bsout...@gmail.com wrote: How about including all or some of Keith's Bottleneck package? He has tried to include some of the discussed functions and tried to make

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Mark Miller
I'd love to see something like a count_unique function included. The numpy.unique function is handy, but it can be a little awkward to efficiently go back and get counts of each unique value after the fact. -Mark On Wed, Jun 1, 2011 at 8:17 AM, Keith Goodman kwgood...@gmail.com wrote: On Tue,

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Craig Yoshioka
would anyone object to fixing the numpy mean and stdv functions, so that they always used a 64-bit value to track sums, or so that they used a running calculation. That way np.mean(np.zeros([4000,4000],'f4')+500) would not equal 511.493408? ` On May 31, 2011, at 6:08 PM, Charles R Harris

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Neal Becker
Short-circuiting find would be nice. Right now, to 'find' something you first make a bool array, then iterate over it. If all you want is the first index where x[i] = e, not very efficient. What I just described is a find with a '==' predicate. Not sure if it's worthwhile to consider other

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Robert Kern
On Wed, Jun 1, 2011 at 10:44, Craig Yoshioka crai...@me.com wrote: would anyone object to fixing the numpy mean and stdv functions, so that they always used a 64-bit value to track sums, or so that they used a running calculation.  That way np.mean(np.zeros([4000,4000],'f4')+500) would

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Bruce Southey
On 06/01/2011 11:01 AM, Robert Kern wrote: On Wed, Jun 1, 2011 at 10:44, Craig Yoshiokacrai...@me.com wrote: would anyone object to fixing the numpy mean and stdv functions, so that they always used a 64-bit value to track sums, or so that they used a running calculation. That way

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Robert Kern
On Wed, Jun 1, 2011 at 11:11, Bruce Southey bsout...@gmail.com wrote: On 06/01/2011 11:01 AM, Robert Kern wrote: On Wed, Jun 1, 2011 at 10:44, Craig Yoshiokacrai...@me.com  wrote: would anyone object to fixing the numpy mean and stdv functions, so that they always used a 64-bit value to track

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Craig Yoshioka
yes, and its probably slower to boot. A quick benchmark on my computer shows that: a = np.zeros([4000,4000],'f4')+500 np.mean(a) takes 0.02 secs np.mean(a,dtype=np.float64) takes 0.1 secs np.mean(a.astype(np.float64)) takes 0.06 secs so casting the whole array is almost 40% faster than

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Skipper Seabold
On Wed, Jun 1, 2011 at 11:31 AM, Mark Miller markperrymil...@gmail.com wrote: I'd love to see something like a count_unique function included. The numpy.unique function is handy, but it can be a little awkward to efficiently go back and get counts of each unique value after the fact. Does

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Mark Miller
Not quite. Bincount is fine if you have a set of approximately sequential numbers. But if you don't a = numpy.array((1,500,1000)) a array([ 1, 500, 1000]) b = numpy.bincount(a) b array([0, 1, 0, ..., 0, 0, 1]) len(b) 1001 -Mark On Wed, Jun 1, 2011 at 9:32 AM, Skipper Seabold

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Christopher Barker
On 5/31/11 6:08 PM, Charles R Harris wrote: 2) Ufunc fadd (nanadd?) Treats nan as zero in addition. so: In [53]: a Out[53]: array([ 1., 2., nan]) In [54]: b Out[54]: array([0, 1, 2]) In [55]: a + b Out[55]: array([ 1., 3., nan]) and nanadd(a,b) would yield: array([ 1., 3., 2.)

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Robert Kern
On Wed, Jun 1, 2011 at 12:30, Christopher Barker chris.bar...@noaa.gov wrote: On 5/31/11 6:08 PM, Charles R Harris wrote: 2) Ufunc fadd (nanadd?) Treats nan as zero in addition. so: In [53]: a Out[53]: array([  1.,   2.,  nan]) In [54]: b Out[54]: array([0, 1, 2]) In [55]: a + b

Re: [Numpy-discussion] New functions.

2011-06-01 Thread josef . pktd
My favorite missing extension to numpy functions np.bincount with 2 (or more) dimensional weights for fast calculation of group statistics. Josef ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] New functions.

2011-06-01 Thread David Cournapeau
On Thu, Jun 2, 2011 at 1:49 AM, Mark Miller markperrymil...@gmail.com wrote: Not quite. Bincount is fine if you have a set of approximately sequential numbers. But if you don't Even worse, it fails miserably if you sequential numbers but with a high shift. np.bincount([10001,

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Travis Oliphant
On May 31, 2011, at 8:08 PM, Charles R Harris wrote: Hi All, I've been contemplating new functions that could be added to numpy and thought I'd run them by folks to see if there is any interest. 1) Modified sort/argsort functions that return the maximum k values. This is easy to do

[Numpy-discussion] New functions.

2011-05-31 Thread Charles R Harris
Hi All, I've been contemplating new functions that could be added to numpy and thought I'd run them by folks to see if there is any interest. 1) Modified sort/argsort functions that return the maximum k values. This is easy to do with heapsort and almost as easy with mergesort. 2) Ufunc

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Robert Kern
On Tue, May 31, 2011 at 20:08, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, I've been contemplating new functions that could be added to numpy and thought I'd run them by folks to see if there is any interest. 1) Modified sort/argsort functions that return the maximum k values.

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Warren Weckesser
On Tue, May 31, 2011 at 8:08 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, I've been contemplating new functions that could be added to numpy and thought I'd run them by folks to see if there is any interest. 1) Modified sort/argsort functions that return the maximum k

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Charles R Harris
On Tue, May 31, 2011 at 7:18 PM, Warren Weckesser warren.weckes...@enthought.com wrote: On Tue, May 31, 2011 at 8:08 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, I've been contemplating new functions that could be added to numpy and thought I'd run them by folks to see

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Benjamin Root
On Tue, May 31, 2011 at 8:18 PM, Warren Weckesser warren.weckes...@enthought.com wrote: On Tue, May 31, 2011 at 8:08 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, I've been contemplating new functions that could be added to numpy and thought I'd run them by folks to see

Re: [Numpy-discussion] New functions.

2011-05-31 Thread David
On 06/01/2011 10:08 AM, Charles R Harris wrote: Hi All, I've been contemplating new functions that could be added to numpy and thought I'd run them by folks to see if there is any interest. 1) Modified sort/argsort functions that return the maximum k values. This is easy to do with

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Charles R Harris
On Tue, May 31, 2011 at 7:33 PM, David da...@silveregg.co.jp wrote: On 06/01/2011 10:08 AM, Charles R Harris wrote: Hi All, I've been contemplating new functions that could be added to numpy and thought I'd run them by folks to see if there is any interest. 1) Modified sort/argsort

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Skipper Seabold
On Tue, May 31, 2011 at 9:31 PM, Benjamin Root ben.r...@ou.edu wrote: On Tue, May 31, 2011 at 8:18 PM, Warren Weckesser warren.weckes...@enthought.com wrote: On Tue, May 31, 2011 at 8:08 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, I've been contemplating new functions

Re: [Numpy-discussion] New functions.

2011-05-31 Thread David
On 06/01/2011 10:34 AM, Charles R Harris wrote: On Tue, May 31, 2011 at 7:33 PM, David da...@silveregg.co.jp mailto:da...@silveregg.co.jp wrote: On 06/01/2011 10:08 AM, Charles R Harris wrote: Hi All, I've been contemplating new functions that could be added to

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Benjamin Root
On Tue, May 31, 2011 at 8:26 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, May 31, 2011 at 7:18 PM, Warren Weckesser warren.weckes...@enthought.com wrote: On Tue, May 31, 2011 at 8:08 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, I've been

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Skipper Seabold
On Tue, May 31, 2011 at 9:53 PM, Warren Weckesser warren.weckes...@enthought.com wrote: On Tue, May 31, 2011 at 8:36 PM, Skipper Seabold jsseab...@gmail.com wrote: I don't know if it's one pass off the top of my head, but I've used percentile for interpercentile ranges. [docs] [1]: X =

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Charles R Harris
On Tue, May 31, 2011 at 8:00 PM, Skipper Seabold jsseab...@gmail.comwrote: On Tue, May 31, 2011 at 9:53 PM, Warren Weckesser warren.weckes...@enthought.com wrote: On Tue, May 31, 2011 at 8:36 PM, Skipper Seabold jsseab...@gmail.com wrote: I don't know if it's one pass off the top of

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Bruce Southey
On Tue, May 31, 2011 at 9:26 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, May 31, 2011 at 8:00 PM, Skipper Seabold jsseab...@gmail.com wrote: On Tue, May 31, 2011 at 9:53 PM, Warren Weckesser warren.weckes...@enthought.com wrote: On Tue, May 31, 2011 at 8:36 PM,

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Charles R Harris
On Tue, May 31, 2011 at 8:50 PM, Bruce Southey bsout...@gmail.com wrote: On Tue, May 31, 2011 at 9:26 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, May 31, 2011 at 8:00 PM, Skipper Seabold jsseab...@gmail.com wrote: On Tue, May 31, 2011 at 9:53 PM, Warren Weckesser