Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df = pd.DataFrame(
- np.arange(16).reshape(4, 4),
- list('wxyz'), list('abcd'))
- a b c d
- w 0 1 2 3
- x 4 5 6 7
- y 8 9 10 11
- z 12 13 14 15
- df.iloc[[0, 3], [1, 2]]
- b c
- w 1 2
- z 13 14
- df.loc[['z', 'x'], ['b', 'c']]
- b c
- z 13 14
- x 5 6
Add Comment
Please, Sign In to add comment