treemap
-
외국인 입국 통계 데이터 분석 With PythonData Analysis/Social Issues 2021. 4. 14. 21:22
1. 데이터 가져오기 국가 통계 포털에서 2018년부터 2020년까지 월별 국적, 목적별 입구 데이터를 가져와서 분석하도록 하겠다. 코드에 문제가 없다면 아래와 같은 데이터를 확인할 수 있을 것이다. import pandas as pd df=pd.read_csv('C:/Users/banad/Downloads/입국.csv',encoding='cp949') df.columns=['Continent','Country','Purpose','Month','Visitors'] df['Year']=df['Month'].apply(lambda x:x.split('. ')[0]) df['Purpose']=df['Purpose'].str.replace('관광','Tour').replace('상용','Business').r..