Re: [Numpy-discussion] 2D array indexing

2014-02-28 Thread Gökhan Sever
Thanks Julian. Mistakenly, I have (a[:1:] + a[:1,:])/2 type of construct somewhere in my code. It works fine, however I wasn't sure if this is something leading to a wrong calculation. Now your explanation makes it clearer. On Fri, Feb 28, 2014 at 6:48 PM, Julian Taylor < jtaylor.deb...@googlemai

Re: [Numpy-discussion] 2D array indexing

2014-02-28 Thread Julian Taylor
On 01.03.2014 00:32, Gökhan Sever wrote: > > Hello, > > Given this simple 2D array: > > In [1]: np.arange(9).reshape((3,3)) > Out[1]: > array([[0, 1, 2], >[3, 4, 5], >[6, 7, 8]]) > > In [2]: a = np.arange(9).reshape((3,3)) > > In [3]: a[:1:] > Out[3]: array([[0, 1, 2]]) > > In

[Numpy-discussion] 2D array indexing

2014-02-28 Thread Gökhan Sever
Hello, Given this simple 2D array: In [1]: np.arange(9).reshape((3,3)) Out[1]: array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]) In [2]: a = np.arange(9).reshape((3,3)) In [3]: a[:1:] Out[3]: array([[0, 1, 2]]) In [4]: a[:1,:] Out[4]: array([[0, 1, 2]]) Could you tell me why the last two