Re: [Numpy-discussion] ufunc for sum of squared difference

2016-11-04 Thread Sebastian Berg
On Fr, 2016-11-04 at 15:42 -0400, Matthew Harrigan wrote: > I didn't notice identity before.  Seems like frompyfunc always sets > it to None.  If it were zero maybe it would work as desired here. > > In the writing your own ufunc doc, I was wondering if the pointer to > data could be used to get

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Chris Barker
On Fri, Nov 4, 2016 at 10:36 AM, Nathaniel Smith wrote: > On Nov 4, 2016 10:32 AM, "Stephan Hoyer" wrote: > > fromiter dynamically resizes a NumPy array, like a Python list, except > with a growth factor of 1.5 > > Oh, right, and the dtype argument is

Re: [Numpy-discussion] ufunc for sum of squared difference

2016-11-04 Thread Matthew Harrigan
I didn't notice identity before. Seems like frompyfunc always sets it to None. If it were zero maybe it would work as desired here. In the writing your own ufunc doc, I was wondering if the pointer to data could be used to get a constant at runtime. If not, what could that be used for? static

Re: [Numpy-discussion] ufunc for sum of squared difference

2016-11-04 Thread Sebastian Berg
On Fr, 2016-11-04 at 13:11 -0400, Matthew Harrigan wrote: > I was reading this and got thinking about if a ufunc could compute > the sum of squared differences in a single pass without a temporary > array.  The python code below demonstrates a possible approach. > > import numpy as np > x =

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Nathaniel Smith
On Nov 4, 2016 10:32 AM, "Stephan Hoyer" wrote: > > On Fri, Nov 4, 2016 at 10:24 AM, Nathaniel Smith wrote: >> >> Are you sure fromiter doesn't make an intermediate list or equivalent? It has to collect all the values before it can know the shape or dtype of the

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Stephan Hoyer
On Fri, Nov 4, 2016 at 10:24 AM, Nathaniel Smith wrote: > Are you sure fromiter doesn't make an intermediate list or equivalent? It > has to collect all the values before it can know the shape or dtype of the > array to put them in. > fromiter dynamically resizes a NumPy array,

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Nathaniel Smith
Are you sure fromiter doesn't make an intermediate list or equivalent? It has to collect all the values before it can know the shape or dtype of the array to put them in. On Nov 4, 2016 5:26 AM, "Francesc Alted" wrote: 2016-11-04 13:06 GMT+01:00 Neal Becker

[Numpy-discussion] ANN: pandas v0.19.1 released!

2016-11-04 Thread Joris Van den Bossche
Hi all, I'm pleased to announce the release of pandas 0.19.1. This is a bug-fix release from 0.19.0 and includes some small regression fixes, bug fixes and performance improvements. We recommend that all users upgrade to this version. See the v0.19.1 Whatsnew page

[Numpy-discussion] ufunc for sum of squared difference

2016-11-04 Thread Matthew Harrigan
I was reading this and got thinking about if a ufunc could compute the sum of squared differences in a single pass without a temporary array. The python code below demonstrates a possible approach. import numpy as np x =

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Robert Kern
On Fri, Nov 4, 2016 at 6:36 AM, Neal Becker wrote: > > Francesc Alted wrote: > > > 2016-11-04 13:06 GMT+01:00 Neal Becker : > > > >> I find I often write: > >> np.array ([some list comprehension]) > >> > >> mainly because list comprehensions are just so

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Neal Becker
Francesc Alted wrote: > 2016-11-04 14:36 GMT+01:00 Neal Becker : > >> Francesc Alted wrote: >> >> > 2016-11-04 13:06 GMT+01:00 Neal Becker : >> > >> >> I find I often write: >> >> np.array ([some list comprehension]) >> >> >> >> mainly because list

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Ryan May
On Fri, Nov 4, 2016 at 9:04 AM, Stephan Hoyer wrote: > On Fri, Nov 4, 2016 at 7:12 AM, Francesc Alted wrote: > >> Does this generalize to >1 dimensions? >>> >> >> A reshape() is not enough? What do you want to do exactly? >> > > np.fromiter takes scalar

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Daπid
On 4 November 2016 at 16:04, Stephan Hoyer wrote: > > But, we also don't have an unstack function. This would mostly be syntactic > sugar, but I think it would be a nice addition. Such a function actually > exists in TensorFlow: >

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Stephan Hoyer
On Fri, Nov 4, 2016 at 7:12 AM, Francesc Alted wrote: > Does this generalize to >1 dimensions? >> > > A reshape() is not enough? What do you want to do exactly? > np.fromiter takes scalar input and only builds a 1D array. So it actually can't combine multiple values at once

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Francesc Alted
2016-11-04 14:36 GMT+01:00 Neal Becker : > Francesc Alted wrote: > > > 2016-11-04 13:06 GMT+01:00 Neal Becker : > > > >> I find I often write: > >> np.array ([some list comprehension]) > >> > >> mainly because list comprehensions are just so sweet. > >> >

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Neal Becker
Francesc Alted wrote: > 2016-11-04 13:06 GMT+01:00 Neal Becker : > >> I find I often write: >> np.array ([some list comprehension]) >> >> mainly because list comprehensions are just so sweet. >> >> But I imagine this isn't particularly efficient. >> > > Right. Using a

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Francesc Alted
2016-11-04 13:06 GMT+01:00 Neal Becker : > I find I often write: > np.array ([some list comprehension]) > > mainly because list comprehensions are just so sweet. > > But I imagine this isn't particularly efficient. > Right. Using a generator and np.fromiter() will avoid the

[Numpy-discussion] array comprehension

2016-11-04 Thread Neal Becker
I find I often write: np.array ([some list comprehension]) mainly because list comprehensions are just so sweet. But I imagine this isn't particularly efficient. I wonder if numpy has a "better" way, and if not, maybe it would be a nice addition?

Re: [Numpy-discussion] Branching NumPy 1.12.x

2016-11-04 Thread Ralf Gommers
On Fri, Nov 4, 2016 at 6:04 AM, Charles R Harris wrote: > Hi All, > > I'm thinking that it is time to branch NumPy 1.12.x. I haven't got > everything in it that I would have liked, in particular __numpy_ufunc__, > but I think there is plenty of material and not