Re: [Numpy-discussion] Traceback on divide by zero error

2007-12-13 Thread Tony S Yu
On Dec 13, 2007, at 2:21 PM, Robert Kern wrote: Tony S Yu wrote: Hello, This is something that's been bothering for awhile. When numpy raises the following divide by zero error: Warning: divide by zero encountered in double_scalars is there a way to get a Traceback on where that warning

Re: [Numpy-discussion] Setting a firm release date for 1st december.

2009-11-02 Thread Tony S Yu
On Nov 2, 2009, at 11:09 AM, numpy-discussion-requ...@scipy.org wrote: From: David Cournapeau courn...@gmail.com Subject: [Numpy-discussion] 1.4.0: Setting a firm release date for 1st december. To: Discussion of Numerical Python numpy-discussion@scipy.org Message-ID:

[Numpy-discussion] OverflowError using _nanop with unsigned integers

2009-11-19 Thread Tony S Yu
Hi, Functions that call _nanop (i.e. nan[arg]min, nan[arg]max) currently fail with unsigned integers. For example: np.nanmin(np.array([0, 1], dtype=np.uint8)) OverflowError: cannot convert float infinity to integer It seems that unsigned integers don't get identified as integers in the

[Numpy-discussion] Bug in nanmin called with unsigned integers

2010-05-25 Thread Tony S Yu
I got bit again by this bug with unsigned integers. (My original changes got overwritten when I updated from svn and, unfortunately, merged conflicts without actually looking over the changes.) In any case, I thought it'd be a good time to bump the issue (with patch). Cheers, -Tony PS: Just

Re: [Numpy-discussion] Bug in nanmin called with unsigned integers

2010-05-26 Thread Tony S Yu
On May 25, 2010, at 10:57 PM, Charles R Harris wrote: On Tue, May 25, 2010 at 8:21 PM, Tony S Yu tsy...@gmail.com wrote: I got bit again by this bug with unsigned integers. (My original changes got overwritten when I updated from svn and, unfortunately, merged conflicts without

[Numpy-discussion] Multiplying numpy floats and python lists

2010-06-20 Thread Tony S Yu
I came across some strange behavior when multiplying numpy floats and python lists: the list is returned unchanged: In [18]: np.float64(1.2) * [1, 2] Out[18]: [1, 2] On the other hand, multiplying an array scalar and a python list gives the expected answer In [19]: np.array(1.2) * [1, 2]

Re: [Numpy-discussion] Multiplying numpy floats and python lists

2010-06-20 Thread Tony S Yu
On Jun 20, 2010, at 2:28 PM, Pauli Virtanen wrote: su, 2010-06-20 kello 13:56 -0400, Tony S Yu kirjoitti: I came across some strange behavior when multiplying numpy floats and python lists: the list is returned unchanged: In [18]: np.float64(1.2) * [1, 2] Out[18]: [1, 2] Probably

[Numpy-discussion] Weird clipping when astype(int) used on large numbers

2008-10-17 Thread Tony S Yu
I ran into this weird behavior with astype(int) In [57]: a = np.array(1E13) In [58]: a.astype(int) Out[58]: array(-2147483648) I understand why large numbers need to be clipped when converting to int (although I would have expected some sort of warning), but I'm puzzled by the negative