반응형
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
- Redshift
- Mac
- matplotlib
- gas
- dataframe
- 파이썬
- Google Spreadsheet
- math
- Google Excel
- list
- Kotlin
- Excel
- GIT
- array
- Java
- SQL
- Github
- Tkinter
- hive
- PANDAS
- numpy
- Apache
- google apps script
- string
- django
- PostgreSQL
- PySpark
- c#
- Python
Archives
- Today
- Total
목록ones (1)
달나라 노트
Python numpy : ones (1로 채워진 array 생성)
numpy의 ones() method는 1로만 채워진 array를 생성합니다. 아래 예시들을 봅시다. import numpy as np arr_ones = np.ones(shape=3) print(arr_ones) -- Result [1. 1. 1.] ones(3)의 의미는 3개의 1을 요소로서 가지는 1차원 array를 생성하라는 의미입니다. 이렇게 ones() method는 기본적으로 1차원 array를 생성합니다. import numpy as np arr_ones = np.ones(shape=3, dtype=int) print(arr_ones) -- Result [1 1 1] 위 예시처럼 dtype 옵션을 이용해서 data type을 명시해줄 수 있습니다. 위 예시는 1의 data type을 모두 ..
Python/Python numpy
2024. 3. 7. 00:57