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

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 alan.is...@gmail.com 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

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 alan.is...@gmail.com wrote: Today I accidentally wrote `uni = np.random.uniform((-0.5,0.5),201)`, supply a tuple instead of separate low and

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 all