반응형
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
- hive
- gas
- Excel
- Github
- Apache
- PostgreSQL
- Redshift
- string
- Google Spreadsheet
- math
- dataframe
- Python
- django
- Tkinter
- GIT
- list
- Google Excel
- Java
- Kotlin
- array
- numpy
- Presto
- PySpark
- PANDAS
- google apps script
- matplotlib
- SQL
- c#
- 파이썬
Archives
- Today
- Total
목록flat (1)
달나라 노트
Python numpy : flatten, flat (array를 1차원으로 변환, 1차원 array indexing)
flatten method는 모든 차원의 array를 1차원으로 바꿔줍니다. import numpy as np arr_test = np.array( [ # 1차 array [1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15] # 2차 array ] ) arr_test_flatten = arr_test.flatten() print(arr_test_flatten) print(arr_test_flatten.ndim) print(type(arr_test_flatten)) -- Result [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15] 1 위 예시를 보면 2차원 array가 1차원 array의 형태로 바뀌었음을 알 수 있습니다. 마치 pytho..
Python/Python numpy
2021. 12. 27. 12:22