감동, 마음이 움직이는 것
[python] np.array에서 원하는 row range출력하기 본문
Tips (Utility, Computer Language, and etc.)
[python] np.array에서 원하는 row range출력하기
Struggler J. 2019. 5. 22. 00:53https://stackoverflow.com/questions/35593994/extract-specific-range-of-columns-in-numpy-array-python
Extract Specific RANGE of columns in numpy array Python
I have an array : e = np.array([[ 0, 1, 2, 3, 5, 6, 7, 8], [ 4, 5, 6, 7, 5, 3, 2, 5], [ 8, 9, 10, 11, 4, 5, 3, 5]]) I want to extract array by its columns in RA...
stackoverflow.com
만약 a라는 어레이의 2부터 4번째 행을 출력하고 싶다면
a[2:5, :]하고 해주면 된다.
만약 특정 row를 출력하고 싶다면 예를들어 1,3,5
a[[1,3,5],:]라고 해주면 된다.
'Tips (Utility, Computer Language, and etc.)' 카테고리의 다른 글
[Latex] table slashbox (0) | 2019.08.19 |
---|---|
[python] sympy 사용기 (0) | 2019.06.20 |
[LaTex] table length 조절하기 (0) | 2019.05.18 |
[Linux] vi편집기에서 줄바꿈 (0) | 2019.05.09 |
[python] PCA and figure (0) | 2019.04.30 |