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 > the numpy/lib folder. T

[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 Robert Kern
On Wed, Jun 1, 2011 at 22:06, Travis Oliphant 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 the view that

Re: [Numpy-discussion] New functions.

2011-06-02 Thread David Cournapeau
On Thu, Jun 2, 2011 at 5:42 PM, wrote: > On Wed, Jun 1, 2011 at 9:35 PM, David Cournapeau wrote: >> On Thu, Jun 2, 2011 at 1:49 AM, Mark Miller >> wrote: >>> Not quite. Bincount is fine if you have a set of approximately >>> sequential numbers. But if you don't >> >> Even worse, it fails m

Re: [Numpy-discussion] New functions.

2011-06-02 Thread josef . pktd
On Wed, Jun 1, 2011 at 9:35 PM, David Cournapeau wrote: > On Thu, Jun 2, 2011 at 1:49 AM, Mark Miller 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

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

Re: [Numpy-discussion] New functions.

2011-06-01 Thread David Cournapeau
On Thu, Jun 2, 2011 at 1:49 AM, Mark Miller 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, 10002]) # will take a lof of

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 http://mail.scipy.org/mailman/listinfo/numpy-d

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Robert Kern
On Wed, Jun 1, 2011 at 12:30, Christopher Barker 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 > Out[55]: arra

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 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

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Skipper Seabold
On Wed, Jun 1, 2011 at 11:31 AM, Mark Miller 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 bincount do what you'

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 setti

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Robert Kern
On Wed, Jun 1, 2011 at 11:11, Bruce Southey wrote: > On 06/01/2011 11:01 AM, Robert Kern wrote: >> On Wed, Jun 1, 2011 at 10:44, Craig Yoshioka  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 u

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 Yoshioka 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

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Robert Kern
On Wed, Jun 1, 2011 at 10:44, Craig Yoshioka 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 not equal

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 p

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 w

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 wrote: > On Tue, May 31, 2011 at

Re: [Numpy-discussion] New functions.

2011-06-01 Thread Keith Goodman
On Tue, May 31, 2011 at 8:41 PM, Charles R Harris wrote: > On Tue, May 31, 2011 at 8:50 PM, Bruce Southey 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 them very fast. > > I don't think the

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Charles R Harris
On Tue, May 31, 2011 at 8:50 PM, Bruce Southey wrote: > On Tue, May 31, 2011 at 9:26 PM, Charles R Harris > wrote: > > > > > > On Tue, May 31, 2011 at 8:00 PM, Skipper Seabold > > wrote: > >> > >> On Tue, May 31, 2011 at 9:53 PM, Warren Weckesser > >> wrote: > >> > > >> > > >> > On Tue, May 31

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Bruce Southey
On Tue, May 31, 2011 at 9:26 PM, Charles R Harris wrote: > > > On Tue, May 31, 2011 at 8:00 PM, Skipper Seabold > wrote: >> >> On Tue, May 31, 2011 at 9:53 PM, Warren Weckesser >> wrote: >> > >> > >> > On Tue, May 31, 2011 at 8:36 PM, Skipper Seabold >> > wrote: >> >> I don't know if it's one p

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Charles R Harris
On Tue, May 31, 2011 at 8:00 PM, Skipper Seabold wrote: > On Tue, May 31, 2011 at 9:53 PM, Warren Weckesser > wrote: > > > > > > On Tue, May 31, 2011 at 8:36 PM, Skipper Seabold > > wrote: > >> I don't know if it's one pass off the top of my head, but I've used > >> percentile for interpercentil

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Skipper Seabold
On Tue, May 31, 2011 at 9:53 PM, Warren Weckesser wrote: > > > On Tue, May 31, 2011 at 8:36 PM, Skipper Seabold > 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 = np.random.random(1000) >> >> [docs] >>

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Warren Weckesser
On Tue, May 31, 2011 at 8:36 PM, Skipper Seabold wrote: > On Tue, May 31, 2011 at 9:31 PM, Benjamin Root wrote: > > > > > > On Tue, May 31, 2011 at 8:18 PM, Warren Weckesser > > wrote: > >> > >> > >> On Tue, May 31, 2011 at 8:08 PM, Charles R Harris > >> wrote: > >>> > >>> Hi All, > >>> > >>> I

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Benjamin Root
On Tue, May 31, 2011 at 8:26 PM, Charles R Harris 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 contempl

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 > 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 an

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Skipper Seabold
On Tue, May 31, 2011 at 9:31 PM, Benjamin Root wrote: > > > On Tue, May 31, 2011 at 8:18 PM, Warren Weckesser > wrote: >> >> >> On Tue, 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

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Charles R Harris
On Tue, May 31, 2011 at 7:33 PM, David 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 functions

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 wi

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

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

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Warren Weckesser
On Tue, 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 eas

Re: [Numpy-discussion] New functions.

2011-05-31 Thread Robert Kern
On Tue, May 31, 2011 at 20:08, 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 t

[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 fadd