| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- list
- c#
- dataframe
- Excel
- hive
- Apache
- PANDAS
- GIT
- matplotlib
- gas
- Java
- Kotlin
- Python
- math
- Redshift
- numpy
- Google Excel
- Google Spreadsheet
- 파이썬
- PySpark
- SQL
- Presto
- array
- string
- Github
- Tkinter
- google apps script
- django
- PostgreSQL
- Today
- Total
목록Python (387)
달나라 노트
matplotlib에서 그래프를 그리는 방법은 아래 링크를 참고하면 됩니다. https://cosmosproject.tistory.com/341 이번에는 그린 그래프를 이미지 파일로 생성해볼건데 savefig method를 사용할 것입니다. import matplotlib.pyplot as plt list_x_values = [1, 2, 3, 4, 5] list_y_values = [10, 30, 15, 20, 5] plt.figure(linewidth=5) plt.plot(list_x_values, list_y_values, color='skyblue', marker='o', markerfacecolor='blue', markersize=12) plt.title('Test graph') plt.xlab..
numpy의 min, max method는 각각 주어진 값들 중 최소값, 최대값을 return합니다. import numpy as np arr_test = np.array([1, 2, 3, 4, 5]) print(arr_test) print(np.min(arr_test)) print(np.max(arr_test)) -- Result [1 2 3 4 5] 1 5 arr_test에서 각각 최소값, 최대값이 return됩니다. 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 ] ) print(arr_test) print(np.min(arr_tes..
numpy의 tolist method는 array를 python의 list로 바꿔줍니다. 변경할 때 array의 차원을 그대로 유지합니다. 2차원 array에 tolist를 적용시키면 list속에 다른 list가 있는 2차원 list의 형태로 반환해준다는 의미이죠. 아래 예시들을 봅시다. import numpy as np arr_test = np.array( [1, 2, 3, 4, 5] # 1차 array ) list_test = arr_test.tolist() print(arr_test) print(list_test) -- Result [1 2 3 4 5] [1, 2, 3, 4, 5] import numpy as np arr_test = np.array( [ # 1차 array [1, 2, 3, 4, ..
import numpy as np arr_test = np.array([1, 2, 3, 4, 5]) arr_test_2 = arr_test arr_test_2[1] = 10 print(arr_test) print(arr_test_2) 위 예시를 봅시다. arr_test에 [1, 2, 3, 4, 5]를 array로 만들어서 할당했습니다. 그리고 arr_test_2 변수에 arr_test를 그대로 할당하교있죠. 이 시점에서 arr_test == arr_test_2일 것입니다. arr_test_2[1] = 10 그리고 arr_test_2의 index = 1 값을 10으로 바꿨죠. 그러면 당연히 arr_test_2는 아래와 같이 바뀔겁니다. [ 1 10 3 4 5] 그러면 이때 arr_test는 [1 2 3 4..