[Python] Numpy np.newaxis 차원 확장
np.newaxis 차원을 확장하는 numpy 함수 행 부분에 np.newaxis를 추가하느냐 열 부분에 np.newaxis를 추가하느냐에 따라 결과 값이 달라진다. import numpy as np # 배열 생성 arr1 = np.array([1, 2, 3, 4], dtype=int) arr2 = np.array([[1, 2], [3, 4]], dtype=int) print(arr1) print(arr2) # 결과 [1 2 3 4] [[1 2] [3 4]] # 일차원 배열 print(arr1[np.newaxis]) print(arr1[:, np.newaxis]) # 결과 [[1 2 3 4]] [[1] [2] [3] [4]] # 이차원 배열 print(arr2[np.newaxis]) print(arr2[..
프로그래밍 언어/Python
2019. 12. 22. 17:46
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 3Dvision
- Novel View Synthesis
- MySQL
- numpy
- MacOS
- Macbook
- nerf
- nginx
- Deep Learning
- nvidia
- 우분투
- pytorch
- error
- SSH
- java
- Computer Vision
- Android
- vscode
- ubuntu
- Docker
- Anaconda
- git
- GPU
- Python
- Machine Learning
- 2-stage Detector
- CUDA
- GaussianSplatting
- Neural Radiance Field
- Object Detection
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함