일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Redshift
- matplotlib
- string
- SQL
- Tkinter
- array
- 파이썬
- Mac
- c#
- gas
- PySpark
- list
- Google Excel
- Github
- Kotlin
- django
- Google Spreadsheet
- google apps script
- PostgreSQL
- numpy
- hive
- Python
- math
- dataframe
- Apache
- Excel
- GIT
- PANDAS
- Java
- Today
- Total
목록Python (384)
달나라 노트
numpy의 power method는 거듭제곱을 계산해줍니다. Syntax numpy.power(a, b) power는 위처럼 사용할 수 있고 a ^ b의 결과를 계산해줍니다. import numpy as np print(np.power(2, 3)) -- Result 8 2 ^ 3 = 8 을 계산한 것을 볼 수 있습니다.

matplotlib의 text method는 그래프에 텍스트를 그릴 수 있게 해줍니다. import matplotlib.pyplot as plt list_x = [10, 20, 30, 40, 50] list_y = [10, 30, 15, 20, 5] plt.plot(list_x, list_y, color='skyblue', marker='o', markerfacecolor='blue', markersize=6) plt.xlim(0, 60) plt.ylim(0, 40) plt.text(x=0, y=0, # text box를 표시할 x, y좌표. (이것은 그래프 속 좌표와 동일.) s='Test text', # 표시할 text fontsize=20, # text 크기 horizontalalignment='l..

matplotlib를 이용하다 보면 그래프의 색깔, 점의 색깔 등 다양한 곳에서 색상을 지정해야 하는 상황이 있습니다. 이때 Color hex code를 이용해서 색상을 지정할 수도 있지만 미리 특정 색상을 keyword와 연결지어서 네이밍을 해둔 색상들이 있습니다. 물론 존재하는 모든 색상에 대해 이런 keyword가 있는 것은 아니고 matplotlib에서 지원하는 색상값들이 있습니다. import matplotlib dict_colors = matplotlib.colors.CSS4_COLORS print(dict_colors) -- Result {'aliceblue': '#F0F8FF', 'antiquewhite': '#FAEBD7', 'aqua': '#00FFFF', 'aquamarine': '#..
Python 내장 함수인 int() method는 어떠한 값을 정수로 변환해주는 역할을 합니다. val_result = '12345' val_result_int = int(val_result) print(val_result_int) print(type(val_result_int)) -- Result 12345 사용법은 위와 같습니다. 그냥 어떤 값을 int() method에 전달하면 됩니다. 그러면 그 값을 정수로 바꿔줍니다. 근데 좀 더 정확하게 말하면 여기에는 숨겨진 내용이 왔습니다. val_result = '12345' val_result_int = int(val_result, base=10) print(val_result_int) print(type(val_result_int)) -- Result..