Indexing ndarray objects using colons works like indexing lists using colons. Just remember there are multiple dimensions now. Remember that when the spot before or after the colon is left blank, Python treats the index as extending to either the beginning or the end of the dimension. A second colon can be specified to instruct Python to, say, skip every other row or reverse the order of rows, depending on the number under the second colon.
The following points need to be remembered when slicing arrays with colons:
Let's see an example. First we load in NumPy and create an array:
Notice that what we created is a ...