| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 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 | 
- gas
- Python
- SQL
- Excel
- Tkinter
- PostgreSQL
- Presto
- Java
- array
- numpy
- list
- Google Spreadsheet
- Google Excel
- GIT
- string
- math
- 파이썬
- google apps script
- Apache
- Kotlin
- django
- PANDAS
- matplotlib
- hive
- Github
- dataframe
- c#
- PySpark
- Redshift
- Today
- Total
목록Python (387)
달나라 노트
 Python matplotlib : stacked bar (bar method로 stacked bar graph 그리기)
								
								
									Python matplotlib : stacked bar (bar method로 stacked bar graph 그리기)
									matplotlib의 bar method를 가지고 stacked bar graph를 그릴 수 있습니다. (bar method = https://cosmosproject.tistory.com/427) import matplotlib.pyplot as plt import numpy as np arr_bottom = np.array([0, 0, 0, 0]) list_x = ['2021', '2022', '2023', '2024'] arr_row_1 = np.array([34, 86, 94, 20]) arr_row_2 = np.array([59, 4, 98, 93]) plt.bar(list_x, arr_row_1, bottom=arr_bottom, width=0.5, color='pink') arr_bottom..
 Python matplotlib : table (table 그리기, 좌표평면 위 표 그리기)
								
								
									Python matplotlib : table (table 그리기, 좌표평면 위 표 그리기)
									matplotlib의 table method는 좌표평면 위에 table을 그리는 기능을 합니다. 예시를 봅시다. import matplotlib.pyplot as plt import pandas as pd df = pd.DataFrame({ 'col1': [1, 2, 3, 4, 5], 'col2': ['a', 'b', 'c', 'd', 'e'] }) print(df) print(df.values) list_col_label = ['col1', 'col2'] list_row_color = ['pink', 'lightskyblue', 'lightgreen', 'royalblue', '#5e84ff'] list_col_color = ['powderblue', 'silver'] plt.table( cellTex..
 Python matplotlib : spy (sparsity pattern, 희소성 패턴 그래프)
								
								
									Python matplotlib : spy (sparsity pattern, 희소성 패턴 그래프)
									데이터를 보다 보면 Sparcity pattern이라는 개념을 접하게 됩니다. 한글로 번역을 해보면 희소성 패턴이라고 하죠. sparce -> 부족한, 희박한 sparcity -> 부족, 희박함 단어의 뜻을 보자면 위와 같습니다. 이러한 sparcity pattern을 그래프로 나타내주는 것이 matplotlib의 spy라는 method라고 합니다. Syntax spy( Z=2D-array, precision=value ) spy method에서 주로 사용하는 parameter는 위와 같습니다. - Z 2차원 array를 받습니다. Sparcity pattern 그래프를 그릴 때 사용되는 데이터입니다. - precision precision = 0이라면 Z에서 0이 아닌 모든 값에 대해 graph가 pl..
 Python matplotlib : pcolormesh, cmap, colorbar (색깔 그래프, color graph)
								
								
									Python matplotlib : pcolormesh, cmap, colorbar (색깔 그래프, color graph)
									pcolormesh method는 color graph를 그릴 수 있게 해줍니다. pcolormesh는 다음과 같이 사용할 수 있습니다. import matplotlib.pyplot as plt plt.pcolormesh( [ [0, 1, 2, 3, 4], [1, 2, 3, 4, 5], [2, 3, 4, 5, 6], [3, 4, 5, 6, 7] ] ) plt.show() 그러면 위같은 결과가 나옵니다. import matplotlib.pyplot as plt plt.pcolormesh( [ [0, 1, 2, 3, 4], [1, 2, 3, 4, 5], [2, 3, 4, 5, 6], [3, 4, 5, 6, 7] ] ) plt.show() 코드를 다시 보면 일단 pcolormesh()에 전달되는 array 또..