Advertisement
lessientelrunya

slicing

Jun 28th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. In [4]:
  2. print(X_train[:, 0]) # Extract the 1st coordinate (indexed by 0) of all elements (:) in the array X_train
  3. [ 1.   2.   3.   5.5  6.   7. ]
  4. In [5]:
  5. print(X_train[:, 1]) # Extract the 2nd coordinate (indexed by 1) of all elements (:) in the array X_train
  6. [ 1.   2.5  1.2  6.3  9.   6. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement