I understand the basic idea behind the : operator like:
A[:] Returns the entire array
A[::-1] Returns the array in reverse.
But suppose iris.data is a n X 4 matrix, what does this do?
X = iris.data[:, (2,3)]
I understand the basic idea behind the : operator like:
A[:] Returns the entire array
A[::-1] Returns the array in reverse.
But suppose iris.data is a n X 4 matrix, what does this do?
X = iris.data[:, (2,3)]
It will get you the second and third column from all rows.
Here you can find some more information: python-slicing-a-multi-dimensional-array and Understanding Python's slice notation