반응형
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 |
Tags
- Apache
- Redshift
- Google Excel
- gas
- django
- PANDAS
- c#
- Java
- Mac
- Tkinter
- google apps script
- Github
- Kotlin
- array
- SQL
- PostgreSQL
- dataframe
- Python
- Google Spreadsheet
- string
- math
- PySpark
- numpy
- list
- hive
- GIT
- Excel
- matplotlib
- 파이썬
Archives
- Today
- Total
목록reshape (1)
달나라 노트
Python numpy : reshape (array의 구조 변경, array의 차원 변경)
array에 10이라는 숫자만 전달하면 위처럼 그냥 숫자데이터가 나옵니다. 별도로 import numpy as np arr_test = np.array(10) print(arr_test) -- Result 10 이것을 1행 1열의 데이터로 바꾸고싶으면 어떻게할까요. 이때 reshape method를 사용할 수 있습니다. import numpy as np arr_test = np.array(10) print(arr_test) arr_test = arr_test.reshape(1, 1) print(arr_test) -- Result 10 [[10]] 위처럼 reshape을 사용하면 [[10]] 처럼 1행 1열의 데이터로 변환되었습니다. - reshape(1, 1) 1 by 1(1 x 1) 데이터로 변환하라는..
Python/Python numpy
2021. 8. 6. 01:58