Re: [Numpy-discussion] is it a bug?

2009-03-12 Thread shuwj5...@163.com
> > On Wed, Mar 11, 2009 at 19:55, shuwj5...@163.com wrote: > > Hi, > > > > import numpy as np > > x = np.arange(30) > > x.shape = (2,3,5) > > > > idx = np.array([0,1]) > > e = x[0,idx,:] > > print e.shape > > #> return

[Numpy-discussion] is it a bug?

2009-03-11 Thread shuwj5...@163.com
Hi, import numpy as np x = np.arange(30) x.shape = (2,3,5) idx = np.array([0,1]) e = x[0,idx,:] print e.shape #> return (2,5). ok. idx = np.array([0,1]) e = x[0,:,idx] print e.shape #-> return (2,3). I think the right answer should be (3,2). Is # it a bug here? my num

[Numpy-discussion] why numpy.round get a different result from python round function?

2009-03-09 Thread shuwj5...@163.com
hi, I read the doc for numpy about round function: - For values exactly halfway between rounded decimal values, Numpy rounds to the nearest even value. Thus 1.5 and 2.5 round to 2.0, -0.5 and 0.5 round to 0.0, etc. Results may also be surprising due to the inexact representation of decimal fr