728x90
Three Dots in Python, What is the Ellipsis Object? | PäksTech (pakstech.com)
numpy - How do you use the ellipsis slicing syntax in Python? - Stack Overflow
고차원 배열에서 슬라이싱을 위해 쓰는 함축적인 표현 방법입니다.
a = arange(16).reshape(2,2,2,2)
a[..., 0]
a[:,:,:,0]
2*2*2*2 배열에서 3, 4줄이 같습니다.
ellipsis는 대괄호 안에서 한 번만 호출이 가능합니다.
a[0, ... ,0]
a[..., 0, ...] # error
'Python' 카테고리의 다른 글
Tensorflow + Alexnet(2012) (0) | 2021.11.15 |
---|---|
Visual Studio 2022 + Python3.9.5(64bit) (0) | 2021.11.15 |
OpenCV Mat 한글 출력(PIL 사용) (0) | 2021.10.24 |
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. (0) | 2021.10.15 |