기술 성공, 실패 기록소

python/ 정수 인덱싱 본문

프로그래밍언어

python/ 정수 인덱싱

sunlab 2020. 7. 5. 21:23
728x90

https://stackoverflow.com/questions/45786104/integer-array-indexing-python

 

Integer array indexing python

import numpy as np a = np.array([[1,2], [3, 4], [5, 6]]) print(a[[0, 1, 2], [0, 1, 0]]) # Prints "[1 4 5]" print(a[[0, 0], [1, 1]]) # Prints "[2 2]" I don't understand why it results [1 4 5] ...

stackoverflow.com

 

 

'프로그래밍언어' 카테고리의 다른 글

git에서 특정 브랜치만 clone하는 방법  (0) 2021.02.10
git 특정 branch 가져오기.  (0) 2020.11.12
cppreference  (0) 2020.10.25
#!/usr/bin/env python  (0) 2020.09.17
np.newaxis  (0) 2020.07.05