Re: [Numpy-discussion] mingw32 and numpy 1.10

2015-08-10 Thread Charles R Harris
On Mon, Aug 10, 2015 at 4:53 PM, Nathaniel Smith wrote: > On Aug 10, 2015 3:38 PM, "Charles R Harris" > wrote: > > > > Mingw32 will not compile current numpy due to initialization of a static > structure slot with a Python C-API function. The function is not considered > a constant expression by

Re: [Numpy-discussion] mingw32 and numpy 1.10

2015-08-10 Thread Nathaniel Smith
On Aug 10, 2015 3:38 PM, "Charles R Harris" wrote: > > Mingw32 will not compile current numpy due to initialization of a static structure slot with a Python C-API function. The function is not considered a constant expression by the old gcc in mingw32. Compilation does work with more recent compil

[Numpy-discussion] mingw32 and numpy 1.10

2015-08-10 Thread Charles R Harris
Mingw32 will not compile current numpy due to initialization of a static structure slot with a Python C-API function. The function is not considered a constant expression by the old gcc in mingw32. Compilation does work with more recent compilers; evidently the meaning of "constant expression" is u

Re: [Numpy-discussion] np.in1d() & sets, bug?

2015-08-10 Thread josef.pktd
On Mon, Aug 10, 2015 at 1:40 PM, Benjamin Root wrote: > > Not really, it is "simply" because ``np.asarray(set([1, 2, 3]))`` > > returns an object array > > Holy crap! To be pedantic, it looks like it turns it into a numpy scalar, > but still! I wouldn't have expected np.asarray() on a set (or dic

Re: [Numpy-discussion] np.in1d() & sets, bug?

2015-08-10 Thread Benjamin Root
> Not really, it is "simply" because ``np.asarray(set([1, 2, 3]))`` > returns an object array Holy crap! To be pedantic, it looks like it turns it into a numpy scalar, but still! I wouldn't have expected np.asarray() on a set (or dictionary, for that matter) to work because order is not guaranteed

Re: [Numpy-discussion] np.in1d() & sets, bug?

2015-08-10 Thread Nathaniel Smith
Another case where refusing to implicitly create object arrays would have avoided a lot of confusion... On Aug 10, 2015 10:13 AM, "Sebastian Berg" wrote: > On Mo, 2015-08-10 at 12:09 -0400, Benjamin Root wrote: > > Just came across this one today: > > > > >>> np.in1d([1], set([0, 1, 2]), assume_u

Re: [Numpy-discussion] np.in1d() & sets, bug?

2015-08-10 Thread Sebastian Berg
On Mo, 2015-08-10 at 12:09 -0400, Benjamin Root wrote: > Just came across this one today: > > >>> np.in1d([1], set([0, 1, 2]), assume_unique=True) > array([ False], dtype=bool) > > >>> np.in1d([1], [0, 1, 2], assume_unique=True) > > array([ True], dtype=bool) > > > I am assuming this has somet

[Numpy-discussion] np.in1d() & sets, bug?

2015-08-10 Thread Benjamin Root
Just came across this one today: >>> np.in1d([1], set([0, 1, 2]), assume_unique=True) array([ False], dtype=bool) >>> np.in1d([1], [0, 1, 2], assume_unique=True) array([ True], dtype=bool) I am assuming this has something to do with the fact that order is not guaranteed with set() objects? I was