Recently someone told me to extract the first two columns of a 2D numpy.ndarray by
firstTwoCols = some2dMatrix[:2]
Where is this notation from and how does it work?
I'm only familiar with the comma separated slicing like
twoCols = some2dMatrix[:,:2]
The : before the comma says to get all rows, and the :2 after the comma says for columns 0 up to but not including 2.