Re: [Numpy-discussion] [enhancement] sum_angle() and sum_polar()

2012-05-29 Thread Robert Jördens
On Tue, May 29, 2012 at 12:06 PM, Charles R Harris wrote: > I'd like to see these functions is scipy somewhere. The function names > aren't very descriptive and the one line summaries don't give a very good > idea of what they do, so I think those bits could use improvement. Mention > of the Hough

Re: [Numpy-discussion] [enhancement] sum_angle() and sum_polar()

2012-05-29 Thread Jerome Kieffer
On Tue, 29 May 2012 10:03:04 -0700 Stéfan van der Walt wrote: > On Mon, May 28, 2012 at 11:53 AM, Travis Oliphant wrote: > > I could see these functions going into scipy.ndimage but again because they > > are not necessarily just image processing functions, and the fact that they > > are so simp

Re: [Numpy-discussion] 1.6.2 no more unique for rows

2012-05-29 Thread Charles R Harris
On Mon, May 28, 2012 at 9:18 PM, wrote: > > https://github.com/numpy/numpy/commit/74b9f5eef8fac643bf9012dbb2ac6b4b19f46892 > broke return_inverse for structured arrays, because of the use of mergesort > > I'm using structured dtypes to get uniques and return_inverse by rows > > >>> groups = np.ra

Re: [Numpy-discussion] [enhancement] sum_angle() and sum_polar()

2012-05-29 Thread Charles R Harris
On Tue, May 29, 2012 at 11:40 AM, Robert Jördens wrote: > On Tue, May 29, 2012 at 11:03 AM, Stéfan van der Walt > wrote: > > On Mon, May 28, 2012 at 11:53 AM, Travis Oliphant > wrote: > >> I could see these functions going into scipy.ndimage but again because > they > >> are not necessarily jus

Re: [Numpy-discussion] [enhancement] sum_angle() and sum_polar()

2012-05-29 Thread Robert Jördens
On Tue, May 29, 2012 at 11:03 AM, Stéfan van der Walt wrote: > On Mon, May 28, 2012 at 11:53 AM, Travis Oliphant wrote: >> I could see these functions going into scipy.ndimage but again because they >> are not necessarily just image processing functions, and the fact that they >> are so simple, p

Re: [Numpy-discussion] [enhancement] sum_angle() and sum_polar()

2012-05-29 Thread Stéfan van der Walt
On Mon, May 28, 2012 at 11:53 AM, Travis Oliphant wrote: > I could see these functions going into scipy.ndimage but again because they > are not necessarily just image processing functions, and the fact that they > are so simple, perhaps they are best put into NumPy itself. I'm wondering about th

Re: [Numpy-discussion] numpy.random.gamma returns 0 for small shape parameters

2012-05-29 Thread Massimo Di Pierro
Another possible solution is to sort the numbers and add them in a binary tree. It reduces the truncation error but makes the problem n- log-n and therefore not worth the trouble. Massimo On May 29, 2012, at 9:45 AM, Pauli Virtanen wrote: > Val Kalatsky gmail.com> writes: >> You'll need some

Re: [Numpy-discussion] numpy.random.gamma returns 0 for small shape parameters

2012-05-29 Thread Pauli Virtanen
Val Kalatsky gmail.com> writes: > You'll need some patience to get non-zeros, especially for k=1e-5 > > In [84]: np.sum(np.random.gamma(1e-5,size=100)!=0.0) > Out[84]: 7259 > that's less than 1%. For k=1e-4 it's ~7% To clarify: the distribution is peaked at numbers that are too small to be r

Re: [Numpy-discussion] silly isscalar question

2012-05-29 Thread Derek Homeier
On 29 May 2012, at 15:42, Nathaniel Smith wrote: >> I note the fine distinction between np.isscalar( ('hello') ) and >> np.isscalar( ('hello'), )... > > NB you mean np.isscalar( ('hello',) ), which creates a single-element > tuple. A trailing comma attached to a value in Python normally creates

Re: [Numpy-discussion] silly isscalar question

2012-05-29 Thread Nathaniel Smith
On Tue, May 29, 2012 at 2:31 PM, Derek Homeier wrote: > On 29 May 2012, at 15:00, Mark Bakker wrote: > >> Why does isscalar('hello') return True? >> >> I thought it would check for a number? > > No, it checks for something that is of 'scalar type', which probably can be > translated as 'not equiva

Re: [Numpy-discussion] silly isscalar question

2012-05-29 Thread Derek Homeier
On 29 May 2012, at 15:00, Mark Bakker wrote: > Why does isscalar('hello') return True? > > I thought it would check for a number? No, it checks for something that is of 'scalar type', which probably can be translated as 'not equivalent to an array'. Since strings can form numpy arrays, I gues

Re: [Numpy-discussion] silly isscalar question

2012-05-29 Thread Nathaniel Smith
On Tue, May 29, 2012 at 2:00 PM, Mark Bakker wrote: > Why does isscalar('hello') return True? > > I thought it would check for a number? > > Numpy 1.6.1 > > Silly question? Nope, but you're thinking of a different sense of "scalar" :-). In numpy, "scalar" means something like "anything that you

[Numpy-discussion] silly isscalar question

2012-05-29 Thread Mark Bakker
Why does isscalar('hello') return True? I thought it would check for a number? Numpy 1.6.1 Silly question? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion