Note
Numpy (19) 본문
728x90
How to reverse the columns of a 2D array?
# Input
arr = np.arange(9).reshape(3,3)
# Solution
arr[:, ::-1]
# output
array([[2, 1, 0],
[5, 4, 3],
[8, 7, 6]])
'Numpy' 카테고리의 다른 글
Numpy (21) (0) | 2022.08.12 |
---|---|
Numpy (20) (0) | 2022.08.11 |
Numpy (18) (0) | 2022.08.09 |
Numpy (17) (0) | 2022.08.08 |
Numpy (16) (0) | 2022.08.07 |
Comments