Note
Numpy (56) 본문
728x90
How to find the maximum value in each row of a numpy array 2d?
# Input
np.random.seed(100)
a = np.random.randint(1,10, [5,3])
a
# 1
np.amax(a, axis=1)
# 2
np.apply_along_axis(np.max, arr=a, axis=1)
# output
array([9, 8, 6, 3, 9])
'Numpy' 카테고리의 다른 글
Numpy (57) (0) | 2022.10.19 |
---|---|
Numpy (55) (0) | 2022.10.14 |
Numpy (54) (0) | 2022.10.13 |
Numpy (53) (0) | 2022.09.21 |
Numpy (52) (0) | 2022.09.20 |
Comments