Note

Numpy (13) 본문

Numpy

Numpy (13)

Jun's N 2022. 8. 3. 20:35

How to get the positions where elements of two arrays match?

a = np.array([1,2,3,2,3,4,3,4,5,6])
b = np.array([7,2,10,2,7,4,9,4,9,8])

np.where(a == b)

# output
(array([1, 3, 5, 7]),)
728x90

'Numpy' 카테고리의 다른 글

Numpy (15)  (0) 2022.08.06
Numpy (14)  (0) 2022.08.05
Numpy (12)  (0) 2022.08.02
Numpy (11)  (0) 2022.07.31
Numpy (10)  (0) 2022.07.30
Comments