Created
June 6, 2014 00:59
-
-
Save richard-to/0fcd4d5251a80121a731 to your computer and use it in GitHub Desktop.
Numpy slicing to get last column and everything but last column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = np.array([ | |
[1.0, 1.1, 1], | |
[1.0, 1.0, 1], | |
[0.0, 0.0, 2], | |
[0.0, 0.1, 2], | |
]) | |
labels = data[:,-1] | |
points = data[0:,:-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment