-
국내 목욕탕/사우나 폐업 수 데이터 분석 & 시각화 With PythonData Analysis/Social Issues 2021. 8. 22. 13:17
코로나로부터 직격탄을 받은 업종이 있다면 바로 대한민국 국민 모두가 사랑하는 바로 목욕탕/사우나일 것이다. 코로나가 터진 초반 시점에는 거의 코로나 감염경로 중에서 꼭 목욕탕이 있을 정도로 목욕탕은 코로나에 너무도 쉽게 노출된 곳이다. 그래서 아래 뉴스와 같이 코로나로 인해 많은 현재 목욕탕이 영업에 어려움을 겪고 있는 중이다.
https://biz.chosun.com/site/data/html_dir/2021/03/18/2021031801148.html
http://news.kmib.co.kr/article/view.asp?arcid=0015707356&code=61121111&sid1=soc
그래서 이번 포스팅에는 실제로 얼마나 많은 목욕탕이 폐점했는지 데이터로 분석해보도록 하겠다. 데이터는 지방행정인허가 데이터를 사용하도록 하겠다.
연도별 목욕탕/사우나 폐업 수
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np import pandas as pd df=pd.read_csv('C:/Users/banad/OneDrive/Documents/카카오톡 받은 파일/목욕장.csv',encoding='cp949') df['폐업일자']=df['폐업일자'].astype(str) df=df[df['폐업일자'].str.startswith('20')] dfc=df[df['영업상태명']=='폐업'] dfc['Closed Date']=dfc['폐업일자'].apply(lambda x: str(x)[2:4] +'년'+' '+str(x)[4:6]+'월') dfc['Year']=dfc['Closed Date'].apply(lambda x:x.split(' ')[0]) counts=pd.DataFrame(dfc.groupby(['Year']).count()['번호']) counts.columns=['폐업 수'] %matplotlib inline %config InlineBackend.figure_format='retina' plt.figure(figsize=(20,10)) plt.rcParams["font.family"] = 'Malgun Gothic' plt.rcParams["font.size"] = 15 plt.bar(counts.index, counts['폐업 수'],color = 'green') plt.title('연도별 목욕탕/사우나 폐장 수',fontsize=25) for x,y in enumerate(list(counts['폐업 수'])): plt.text(x, y, y, fontsize=17, color='#ff0000', horizontalalignment='center', verticalalignment='bottom')
근데 생각보다 코로나 이후 오히려 목욕탕/사우나 폐장한 수가 그렇게 많지가 않았다. 오히려 2000년 초에 목욕탕이 더 많이 폐장한 점을 확인할 수 있다.
시도별 목욕탕/사우나 폐업 수
위에서 내가 원하는대로 데이터가 안 나와서 그냥 추가로 시도별 폐점 수를 비교해보도록 하겠다.
dfcc=dfc[~dfc['도로명전체주소'].isnull()] dfcc['시도']=dfcc['도로명전체주소'].apply(lambda x: x.split(' ')[0]) sido=pd.DataFrame(dfcc.groupby(['시도']).count()['번호']) sido.columns=['폐업 수'] sido=sido.sort_values(by='폐업 수',ascending=False) plt.figure(figsize=(20,10)) plt.rcParams["font.family"] = 'Malgun Gothic' plt.rcParams["font.size"] = 15 plt.bar(sido.index, sido['폐업 수'],color = 'green') plt.title('2020~2021년 시도별 목욕탕/사우나 폐장 수',fontsize=25) for x,y in enumerate(list(sido['폐업 수'])): plt.text(x, y, y, fontsize=17, color='#ff0000', horizontalalignment='center', verticalalignment='bottom') plt.xticks(rotation=45) plt.show()
역시 인구 수가 가장 많은 서울, 경기 순으로 많은 목욕탕이 폐점된 점을 볼 수 있다.
'Data Analysis > Social Issues' 카테고리의 다른 글
코로나19 예방접종센터 현황 확인 - 지도 시각화 With Python, Pydeck (1) 2021.06.09 외국인 입국 통계 데이터 분석 With Python (1) 2021.04.14 2010~2020년 국내 시도별 예금은행 예금액 분석 with Python (0) 2021.04.13 전국 시도별 빈집 상황 알아보자 with Python (0) 2021.04.11 2015년 ~ 2019년 대한민국 인구 10만명당 자살 통계 데이터 분석 With Python (0) 2021.04.02