반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- Python
- Redshift
- Tkinter
- Apache
- dataframe
- Excel
- math
- array
- Kotlin
- google apps script
- gas
- Java
- PySpark
- PANDAS
- hive
- Google Excel
- numpy
- Github
- matplotlib
- Google Spreadsheet
- GIT
- list
- 파이썬
- django
- PostgreSQL
- string
- SQL
- Mac
- c#
Archives
- Today
- Total
목록array.T (1)
달나라 노트
Python numpy : T (numpy array transpose, array 행/열 바꾸기)
numpy에서 T attribute는 numpy array를 transpose해줍니다. 좀 직관적으로 이해하려면 흔히 말하는 행과 열을 바꿔준다는 느낌으로 받아들이면 될 것 같습니다. 아래 예시를 봅시다. import numpy as np arr_test = np.array( [ # 1차 array [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5] # 2차 array ] ) print(arr_test) print(arr_test.shape) arr_test_t = arr_test.T print(arr_test_t) print(arr_test_t.shape) -- Result [[1 2 3 4 5] [1 2 3 4 5] [1 2 3 4 5]] (3, 5) [[1 1 ..
Python/Python numpy
2021. 12. 27. 12:05