vectorized indexing

    [NumPy] Fancy Indexing

    NumPy에서 indexing은 4가지 방식을 따름. scalar를 이용한 indexing ( simple indexing ) : array[0] slicing boolean mask : array[array > 1] fancy indexing : vectorized indexing. index들을 element로 가지는 array를 넘겨줌. combined indexing : 앞서 4가지가 조합된 indexing Fancy Indexing image(or matrix)등에서 높이 (row, height), 넓이 (column, width)에 대해, 접근하고자하는 pixel (or entry)들의 index를 square bracket안에 넘겨주는 방식임. 간단하게 1차원에서 확인한다면 다음과 같음. i..