Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-17 Thread Charles R Harris
On Mon, Sep 17, 2012 at 3:40 PM, Travis Oliphant wrote: > > On Sep 17, 2012, at 8:42 AM, Benjamin Root wrote: > > > Consider the following code: > > > > import numpy as np > > a = np.array([1, 2, 3, 4, 5], dtype=np.int16) > > a *= float(255) / 15 > > > > In v1.6.x, this yields: > > array([17, 34,

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-17 Thread Travis Oliphant
On Sep 17, 2012, at 8:42 AM, Benjamin Root wrote: > Consider the following code: > > import numpy as np > a = np.array([1, 2, 3, 4, 5], dtype=np.int16) > a *= float(255) / 15 > > In v1.6.x, this yields: > array([17, 34, 51, 68, 85], dtype=int16) > > But in master, this throws an exception abou

[Numpy-discussion] Inconsistencies with string indices

2012-09-17 Thread Ronan Lamy
Consider the following: >>> import numpy as np >>> np.__version__ '1.6.1' >>> arr = np.asarray([[1, 2, 3]]) >>> arr["0"] Traceback (most recent call last): File "", line 1, in arr["0"] ValueError: field named 0 not found. >>> arr["0",] array([1, 2, 3]) >>> arr["0", 1] 2 >>> arr[0, "1"] 2 >

[Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-17 Thread Benjamin Root
Consider the following code: import numpy as np a = np.array([1, 2, 3, 4, 5], dtype=np.int16) a *= float(255) / 15 In v1.6.x, this yields: array([17, 34, 51, 68, 85], dtype=int16) But in master, this throws an exception about failing to cast via same_kind. Note that numpy was smart about this o

Re: [Numpy-discussion] tests for casting table? (was: Numpy 1.7b1 API change cause big trouble)

2012-09-17 Thread Matthew Brett
Hi, On Sun, Sep 9, 2012 at 6:12 PM, Frédéric Bastien wrote: > The third is releated to change to the casting rules in numpy. Before > a scalar complex128 * vector float32 gived a vector of dtype > complex128. Now it give a vector of complex64. The reason is that now > the scalar of different cate