Guest User

Untitled

a guest
Mar 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. df = pd.DataFrame(
  2. np.arange(16).reshape(4, 4),
  3. list('wxyz'), list('abcd'))
  4.  
  5. a b c d
  6. w 0 1 2 3
  7. x 4 5 6 7
  8. y 8 9 10 11
  9. z 12 13 14 15
  10.  
  11. df.iloc[[0, 3], [1, 2]]
  12.  
  13. b c
  14. w 1 2
  15. z 13 14
  16.  
  17. df.loc[['z', 'x'], ['b', 'c']]
  18.  
  19. b c
  20. z 13 14
  21. x 5 6
Add Comment
Please, Sign In to add comment