티스토리 뷰
지도 시각화
GeoPandas
!pip install geopandas
import pandas as pd
import geopandas as gpd
import matplotlib.pyplot as plt
path = '/content/drive/MyDrive/NLP_project/프로젝트 #1/project/data/'
test = pd.read_csv(f'{path}map/count.csv')
kr_sido = gpd.read_file(f'{path}map/a', encoding='cp949')
kr_sido = kr_sido.merge(test, on='CTP_KOR_NM')
kr_sido

from mpl_toolkits.axes_grid1 import make_axes_locatable
fig, ax = plt.subplots(figsize=(15, 15),
facecolor='white')
ax.axis('off')
kr_sido.plot(column='count',
cmap='coolwarm',
ax=ax,
alpha=.4,
)
plt.show()

외각선 추가
kr_sido.boundary.plot(ax=ax, color='white')
from mpl_toolkits.axes_grid1 import make_axes_locatable
fig, ax = plt.subplots(figsize=(15, 15),
facecolor='white')
ax.axis('off')
############################################
kr_sido.boundary.plot(ax=ax, color='white')#
############################################
kr_sido.plot(column='count',
cmap='coolwarm',
ax=ax,
alpha=.4,
)
plt.show()

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- arguments
- recursive function
- sep=
- 덮어쓰기
- matplotlib
- _meaning
- _의미
- print()
- recursive
- sdsad
- 재귀함수 이해
- Python
- 재귀?
- list comprehension
- 이중 프린트
- d asd asd
- 백준
- 연산속도
- underscore
- 변수 덮어쓰기
- 재귀함수 설명
- asd ad
- parameters
- 이스케이프 코드
- 콘다
- 파이썬
- 파이썬 변수
- conda
- sad asd
- anaconda
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함