[Numpy-discussion] Custom __array_interface__ error

2015-03-13 Thread Daniel Smith
Greetings everyone, I have a new project that deals with core and disk tensors wrapped into a single object so that the expressions are transparent to the user after the tensor is formed. I would like to add __array_interface__ to the core tensor and provide a reasonable error message if someone

Re: [Numpy-discussion] Numpy 1.10

2015-03-13 Thread Benjamin Root
Release minion? Sounds a lot like an academic minion: https://twitter.com/academicminions On Fri, Mar 13, 2015 at 2:51 AM, Ralf Gommers wrote: > > > On Fri, Mar 13, 2015 at 7:29 AM, Jaime Fernández del Río < > jaime.f...@gmail.com> wrote: > >> On Thu, Mar 12, 2015 at 10:16 PM, Charles R Harris <

[Numpy-discussion] Pandas v0.16.0 release candidate 1

2015-03-13 Thread Jeff Reback
Hi, I'm pleased to announce the availability of the first release candidate of Pandas 0.16.0. Please try this RC and report any issues here: Pandas Issues We will be releasing officially in 1 week or so. This is a major release from 0.15.2 and includes a

[Numpy-discussion] argument handling by uniform

2015-03-13 Thread Alan G Isaac
Today I accidentally wrote `uni = np.random.uniform((-0.5,0.5),201)`, supply a tuple instead of separate low and high values. This gave me two draws (from [0..201] I think). My question: how were the arguments interpreted? Thanks, Alan Isaac ___ NumPy

Re: [Numpy-discussion] argument handling by uniform

2015-03-13 Thread Robert Kern
On Fri, Mar 13, 2015 at 3:57 PM, Alan G Isaac wrote: > > Today I accidentally wrote `uni = np.random.uniform((-0.5,0.5),201)`, > supply a tuple instead of separate low and high values. This gave > me two draws (from [0..201] I think). My question: how were the > arguments interpreted? Broadcast

Re: [Numpy-discussion] argument handling by uniform

2015-03-13 Thread Eric Moore
`low` and `high` can be arrays so, you received 1 draw from (-0.5, 201) and 1 draw from (0.5, 201). Eric On Fri, Mar 13, 2015 at 11:57 AM, Alan G Isaac wrote: > Today I accidentally wrote `uni = np.random.uniform((-0.5,0.5),201)`, > supply a tuple instead of separate low and high values. This

Re: [Numpy-discussion] argument handling by uniform

2015-03-13 Thread Sebastian Berg
On Fr, 2015-03-13 at 11:57 -0400, Alan G Isaac wrote: > Today I accidentally wrote `uni = np.random.uniform((-0.5,0.5),201)`, > supply a tuple instead of separate low and high values. This gave > me two draws (from [0..201] I think). My question: how were the > arguments interpreted? > I think

Re: [Numpy-discussion] Numpy where

2015-03-13 Thread John Kirkham
Hey Everyone, I felt like I should add to the mix. I added the issue ( https://github.com/numpy/numpy/issues/5679 ) to tie these options together. My main concern is that both wheres behave the same. As far as using a scalar as the first argument, it was an easy example. We could have used actu

Re: [Numpy-discussion] Custom __array_interface__ error

2015-03-13 Thread Stephan Hoyer
In my experience writing ndarray-like objects, you likely want to implement __array__ instead of __array_interface__. The former gives you full control to create the ndarray yourself. On Fri, Mar 13, 2015 at 7:22 AM, Daniel Smith wrote: > Greetings everyone, > I have a new project that deals wit

Re: [Numpy-discussion] argument handling by uniform

2015-03-13 Thread Alan G Isaac
On 3/13/2015 12:01 PM, Robert Kern wrote: > Roughly equivalent to: > > uni = np.array([ >np.random.uniform(-0.5, 201), >np.random.uniform(0.5, 201), > ]) OK, broadcasting of `low` and `high` is reasonably fun. But is it documented? I was looking at the docstring, which matches the online

[Numpy-discussion] random.RandomState and deepcopy

2015-03-13 Thread Neal Becker
It is common that to guarantee good statistical independence between various random generators, a singleton instance of an RNG is shared between them. So I typically have various random generator objects, which (sometimes several levels objects deep) embed an instance of RandomState. Now I have

Re: [Numpy-discussion] [pydata] Pandas v0.16.0 release candidate 1

2015-03-13 Thread Paul Hobson
Thanks for the all the hard work! Really looking forward to using the `assign` method in long chained statements. -Paul On Fri, Mar 13, 2015 at 8:33 AM, Jeff Reback wrote: > Hi, > > I'm pleased to announce the availability of the first release candidate of > Pandas 0.16.0. > Please try this RC

Re: [Numpy-discussion] random.RandomState and deepcopy

2015-03-13 Thread Robert Kern
On Fri, Mar 13, 2015 at 5:34 PM, Neal Becker wrote: > > It is common that to guarantee good statistical independence between various > random generators, a singleton instance of an RNG is shared between them. > > So I typically have various random generator objects, which (sometimes > several leve

Re: [Numpy-discussion] random.RandomState and deepcopy

2015-03-13 Thread Neal Becker
Robert Kern wrote: > On Fri, Mar 13, 2015 at 5:34 PM, Neal Becker wrote: >> >> It is common that to guarantee good statistical independence between > various >> random generators, a singleton instance of an RNG is shared between them. >> >> So I typically have various random generator objects, wh

Re: [Numpy-discussion] random.RandomState and deepcopy

2015-03-13 Thread Robert Kern
On Fri, Mar 13, 2015 at 5:59 PM, Neal Becker wrote: > > Robert Kern wrote: > > > On Fri, Mar 13, 2015 at 5:34 PM, Neal Becker wrote: > >> > >> It is common that to guarantee good statistical independence between > > various > >> random generators, a singleton instance of an RNG is shared between

Re: [Numpy-discussion] Custom __array_interface__ error

2015-03-13 Thread Nathaniel Smith
On Mar 13, 2015 7:22 AM, "Daniel Smith" wrote: > > Greetings everyone, > I have a new project that deals with core and disk tensors wrapped into a single object so that the expressions are transparent to the user after the tensor is formed. I would like to add __array_interface__ to the core tenso

Re: [Numpy-discussion] Numpy where

2015-03-13 Thread Nathaniel Smith
On Thu, Mar 12, 2015 at 9:35 PM, Benjamin Root wrote: > I think the question is if scalars should be acceptable for the first > argument, not if it should be for the 2nd and 3rd argument. > > If scalar can be given for the first argument, the the first three makes > sense. Although, I have no clue

Re: [Numpy-discussion] Numpy where

2015-03-13 Thread Nathaniel Smith
On Thu, Mar 12, 2015 at 5:02 PM, Charles R Harris wrote: > Hi All, > > This is apropos gh-5582 dealing with some corner cases of np.where. The > following are the current behavior > import numpy numpy.where(True) # case 1 > ... (array([0]),) numpy.where(True, None, None) # case 2

Re: [Numpy-discussion] Numpy where

2015-03-13 Thread Charles R Harris
On Fri, Mar 13, 2015 at 1:26 PM, Nathaniel Smith wrote: > On Thu, Mar 12, 2015 at 9:35 PM, Benjamin Root wrote: > > I think the question is if scalars should be acceptable for the first > > argument, not if it should be for the 2nd and 3rd argument. > > > > If scalar can be given for the first a

Re: [Numpy-discussion] Numpy where

2015-03-13 Thread Charles R Harris
On Fri, Mar 13, 2015 at 2:09 PM, Charles R Harris wrote: > > > On Fri, Mar 13, 2015 at 1:26 PM, Nathaniel Smith wrote: > >> On Thu, Mar 12, 2015 at 9:35 PM, Benjamin Root wrote: >> > I think the question is if scalars should be acceptable for the first >> > argument, not if it should be for the