반응형
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
- Excel
- c#
- Apache
- hive
- GIT
- Redshift
- matplotlib
- Tkinter
- Google Excel
- dataframe
- math
- gas
- Kotlin
- Github
- numpy
- 파이썬
- SQL
- Python
- google apps script
- PANDAS
- Google Spreadsheet
- PySpark
- list
- array
- Java
- Mac
- PostgreSQL
- string
- django
Archives
- Today
- Total
목록zeros_like (1)
달나라 노트
Python numpy : zeros_like (같은 크기의 0으로 채워진 행렬 생성, 같은 크기의 행렬 생성)
numpy의 zeros_like method는 전달받은 array와 동일한 모양의 array를 생성하고 그 요소를 모두 0으로 채웁니다. import numpy as np arr_test = np.array( [ [9, 1, 5, 7], [2, 6, 5, 8], [0, 3, 0, 2], [4, 0, 7, 3] ] ) print(arr_test) arr_test_zero = np.zeros_like(arr_test) print(arr_test_zero) -- Result [[9 1 5 7] [2 6 5 8] [0 3 0 2] [4 0 7 3]] [[0 0 0 0] [0 0 0 0] [0 0 0 0] [0 0 0 0]] 위 예시를 보면 arr_test와 동일한 모양이지만 요소가 모두 0으로 채워진 새로운 a..
Python/Python numpy
2022. 3. 22. 19:10