I have recently started learning NumPy (an extension of Python) and I am very confused by several things. In this post I would like help in one of them.
Let's say I have the following (forgive me if I do some mistake)
>>>a=arange(12) >>> a=a.reshape(3,4) >>> a array([[0,1,2,3], [4,5,6,7], [8,9,10,11]])
And also have some arrays of booleans say
Now, I do the following
>>>a[b1,:] array([[4,5,6,7], [8,9,10,11]]) >>>a[:,b2] array([[0,2], [4,6], [8,10]])
which is understandable.
But, where on earth does the following come from???
I mean, I can not understand where does that come from and how did it end up like that. I would think that would give a result such as
Can someone help me understand this? I will be very grateful. Thanks in advance
Edited by KansaiRobot, 12 February 2015 - 06:14 PM.