AI ์ค๋ฌด ๊ธฐ๋ณธ ๊ณผ์
[๊ธฐ๋ณธํ๋ก์ ํธ] 01 ๊ตญ๋ด ์ฝ๋ก๋ ํ์ ๋ฐ์ดํฐ๋ฅผ ํ์ฉํ ๋ฐ์ดํฐ ๋ถ์
ํ๋ก์ ํธ ๋ชฉํ
์์ธ์ ์ฝ๋ก๋19 ํ์ง์ ํํฉ ๋ฐ์ดํฐ๋ฅผ ๋ถ์ํ์ฌ ์ ์๋ฏธํ ์ ๋ณด ๋์ถ
ํ์์ ๋ฐ์ดํฐ ๋ถ์์ ์ํํ๊ธฐ ์ํ ๋ฐ์ดํฐ ์ ์ , ํน์ฑ ์์ง๋์ด๋ง, ์๊ฐํ ๋ฐฉ๋ฒ ํ์ต
- ํ๋ก์ ํธ ๋ชฉ์ฐจ
- ๋ฐ์ดํฐ ์ฝ๊ธฐ: ์ฝ๋ก๋ ๋ฐ์ดํฐ๋ฅผ ๋ถ๋ฌ์ค๊ณ Dataframe ๊ตฌ์กฐ๋ฅผ ํ์ธ
1.1. ๋ฐ์ดํฐ ๋ถ๋ฌ์ค๊ธฐ - ๋ฐ์ดํฐ ์ ์ : ๋น์ด ์๋ ๋ฐ์ดํฐ ๋๋ ์ธ๋ชจ ์๋ ๋ฐ์ดํฐ๋ฅผ ์ญ์
2.1. ๋น์ด์๋ column ์ง์ฐ๊ธฐ - ๋ฐ์ดํฐ ์๊ฐํ: ๊ฐ ๋ณ์ ๋ณ๋ก ์ถ๊ฐ์ ์ธ ์ ์ ๋๋ feature engineering ๊ณผ์ ์ ๊ฑฐ์น๊ณ ์๊ฐํ๋ฅผ ํตํ์ฌ ๋ฐ์ดํฐ์ ํน์ฑ ํ์
3.1. ํ์ง์ผ ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌํ๊ธฐ
3.2. ์๋ณ ํ์ง์ ์ ์ถ๋ ฅ
3.3. 8์ ์ผ๋ณ ํ์ง์ ์ ์ถ๋ ฅ
3.4. ์ง์ญ๋ณ ํ์ง์ ์ ์ถ๋ ฅ
3.5. 8์๋ฌ ์ง์ญ๋ณ ํ์ง์ ์ ์ถ๋ ฅ
3.6. ์๋ณ ๊ด์ ๊ตฌ ํ์ง์ ์ ์ถ๋ ฅ
3.7. ์์ธ ์ง์ญ์์ ํ์ง์๋ฅผ ์ง๋์ ์ถ๋ ฅ
- ๋ฐ์ดํฐ ์ฝ๊ธฐ: ์ฝ๋ก๋ ๋ฐ์ดํฐ๋ฅผ ๋ถ๋ฌ์ค๊ณ Dataframe ๊ตฌ์กฐ๋ฅผ ํ์ธ
๋ฐ์ดํฐ ์ถ์ฒ
https://data.seoul.go.kr/dataList/OA-11677/S/1/datasetView.do
https://www.data.go.kr/tcs/dss/selectFileDataDetailView.do?publicDataPk=15063273
https://2021nipa.elice.io/explore
1. ๋ฐ์ดํฐ ์ฝ๊ธฐ
ํ์ํ ํจํค์ง ์ค์น ๋ฐ importํ ํ pandas๋ฅผ ์ฌ์ฉํ์ฌ ๋ฐ์ดํฐ๋ฅผ ์ฝ๊ณ ์ด๋ ํ ๋ฐ์ดํฐ๊ฐ ์ ์ฅ๋์ด ์๋์ง ํ์ธํฉ๋๋ค.
1-1. ๋ฐ์ดํฐ ๋ถ๋ฌ์ค๊ธฐ
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# pd.read_csv๋ฅผ ํตํ์ฌ dataframe ํํ๋ก ์ฝ์ด์ต๋๋ค.
corona_all=pd.read_csv("./data/์์ธ์ ์ฝ๋ก๋19 ํ์ง์ ํํฉ.csv")
# ์์ 5๊ฐ ๋ฐ์ดํฐ๋ฅผ# ์ถ๋ ฅํฉ๋๋ค.
corona_all.head()
# dataframe ์ ๋ณด๋ฅผ ์์ฝํ์ฌ ์ถ๋ ฅํฉ๋๋ค.
corona_all.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5748 entries, 0 to 5747
Data columns (total 14 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 ์ฐ๋ฒ 5748 non-null int64
1 ํ์ง์ผ 5748 non-null object
2 ํ์๋ฒํธ 5748 non-null int64
3 ๊ตญ์ 0 non-null float64
4 ํ์์ ๋ณด 0 non-null float64
5 ์ง์ญ 5748 non-null object
6 ์ฌํ๋ ฅ 459 non-null object
7 ์ ์ด๋ ฅ 5748 non-null object
8 ์กฐ์น์ฌํญ 0 non-null float64
9 ์ํ 5357 non-null object
10 ์ด๋๊ฒฝ๋ก 5520 non-null object
11 ๋ฑ๋ก์ผ 5748 non-null object
12 ์์ ์ผ 5748 non-null object
13 ๋
ธ์ถ์ฌ๋ถ 5748 non-null object
dtypes: float64(3), int64(2), object(9)
memory usage: 628.8+ KB
2. ๋ฐ์ดํฐ ์ ์
๋ฐ์ดํฐ๋ฅผ ์ฝ๊ณ ํ์ธํ๋ค๋ฉด ๊ฒฐ์ธก๊ฐ(missing data), ์ด์์น(outlier)๋ฅผ ์ฒ๋ฆฌํ๋ ๋ฐ์ดํฐ ์ ์ ๊ณผ์ ์ ์ํํ์ฌ ๋ด ์๋ค.
2-1. ๋น์ด์๋ ์นผ๋ผ ์ญ์
# drop ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ๊ตญ์ , ํ์์ ๋ณด, ์กฐ์น์ฌํญ coulmn ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํฉ๋๋ค.
corona_del_col = corona_all.drop(columns = ['๊ตญ์ ','ํ์์ ๋ณด','์กฐ์น์ฌํญ'])
# ์ ์ ์ฒ๋ฆฌ๋ dataframe ์ ๋ณด๋ฅผ ์ถ๋ ฅํฉ๋๋ค.
corona_del_col.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5748 entries, 0 to 5747
Data columns (total 11 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 ์ฐ๋ฒ 5748 non-null int64
1 ํ์ง์ผ 5748 non-null object
2 ํ์๋ฒํธ 5748 non-null int64
3 ์ง์ญ 5748 non-null object
4 ์ฌํ๋ ฅ 459 non-null object
5 ์ ์ด๋ ฅ 5748 non-null object
6 ์ํ 5357 non-null object
7 ์ด๋๊ฒฝ๋ก 5520 non-null object
8 ๋ฑ๋ก์ผ 5748 non-null object
9 ์์ ์ผ 5748 non-null object
10 ๋
ธ์ถ์ฌ๋ถ 5748 non-null object
dtypes: int64(2), object(9)
memory usage: 494.1+ KB
3. ๋ฐ์ดํฐ ์๊ฐํ
๋ฐ์ดํฐ ์ ์ ๋ฅผ ์๋ฃํ corona_del_col ๋ฐ์ดํฐ๋ฅผ ๋ฐํ์ผ๋ก ๊ฐ column์ ๋ณ์๋ณ๋ก ์ด๋ ํ ๋ฐ์ดํฐ ๋ถํฌ๋ฅผ ํ๊ณ ์๋์ง ์๊ฐํ๋ฅผ ํตํ์ฌ ์์๋ด ์๋ค.
3-1. ํ์ง์ผ ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ
corona_del_col['ํ์ง์ผ']
0 10.21.
1 10.21.
2 10.21.
3 10.21.
4 10.21.
...
5743 1.31.
5744 1.30.
5745 1.30.
5746 1.30.
5747 1.24.
Name: ํ์ง์ผ, Length: 5748, dtype: object
ํ์ง์ผ์ ์ ์ฅ๋ ๋ฌธ์์ด ๋ฐ์ดํฐ๋ฅผ ๋๋์ด month, day column์ int64 ํํ๋ก ์ ์ฅํด ๋ด ์๋ค.
# dataframe์ ์ถ๊ฐํ๊ธฐ ์ , ์์๋ก ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํด ๋ list๋ฅผ ์ ์ธํฉ๋๋ค.
month = []
day = []
for data in corona_del_col['ํ์ง์ผ']:
# split ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์, ์ผ์ ๋๋์ด list์ ์ ์ฅํฉ๋๋ค.
month.append(data.split('.')[0])
day.append(data.split('.')[1])
# corona_del_col์ `month`, `day` column์ ์์ฑํ๋ฉฐ ๋์์ list์ ์์ ์ ์ฅ๋ ๋ฐ์ดํฐ๋ฅผ ์
๋ ฅํฉ๋๋ค.
corona_del_col['month'] = month
corona_del_col['day'] = day
corona_del_col['month'].astype('int64')
corona_del_col['day'].astype('int64')
0 21
1 21
2 21
3 21
4 21
..
5743 31
5744 30
5745 30
5746 30
5747 24
Name: day, Length: 5748, dtype: int64
3-2. ์๋ณ ํ์ง์ ์ ์ถ๋ ฅ
๋๋์ด์ง month์ ๋ฐ์ดํฐ๋ฅผ ๋ฐํ์ผ๋ก ๋ฌ๋ณ ํ์ง์ ์๋ฅผ ๋ง๋๊ทธ๋ํ๋ก ์ถ๋ ฅํด ๋ณด๊ฒ ์ต๋๋ค.
# ๊ทธ๋ํ์์ x์ถ์ ์์๋ฅผ ์ ๋ฆฌํ๊ธฐ ์ํ์ฌ order list๋ฅผ ์์ฑํฉ๋๋ค.
order = []
for i in range(1,11):
order.append(str(i))
order #['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
# ๊ทธ๋ํ์ ์ฌ์ด์ฆ๋ฅผ ์กฐ์ ํฉ๋๋ค.
plt.figure(figsize=(10,5))
# seaborn์ countplot ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์ถ๋ ฅํฉ๋๋ค.
sns.set(style="darkgrid")
ax = sns.countplot(x="month", data=corona_del_col, palette="Set2", order = order)
# series์ plot ํจ์๋ฅผ ์ฌ์ฉํ ์ถ๋ ฅ ๋ฐฉ๋ฒ๋ ์์ต๋๋ค.
corona_del_col['month'].value_counts().plot(kind='bar')
# value_counts()๋ ๊ฐ ๋ฐ์ดํฐ๋ฅผ ์ธ์ด์ ๋ด๋ฆผ์ฐจ์์ผ๋ก ์ ๋ฆฌํ๋ ํจ์์
๋๋ค.
corona_del_col['month'].value_counts()
8 2416
9 1304
6 460
10 425
3 391
7 281
5 228
4 156
2 80
1 7
Name: month, dtype: int64
3-3. 8์๋ฌ ์ผ๋ณ ํ์ง์ ์ ์ถ๋ ฅ
์๋ณ ํ์ง์ ์๋ฅผ ์ถ๋ ฅํด๋ณด๋ฉด ์ ์ ์๋ฏ์ด 8์์ ํ์ง์ ์๊ฐ ๊ฐ์ฅ ๋ง์์ต๋๋ค. ์ด๋ฒ์ 8์ ๋์ ํ์ง์ ์๊ฐ ์ด๋ป๊ฒ ๋์๋์ง ์ผ๋ณ ํ์ง์ ์๋ฅผ ๋ง๋๊ทธ๋ํ๋ก ์ถ๋ ฅํด ๋ด ์๋ค.
# ๊ทธ๋ํ์์ x์ถ์ ์์๋ฅผ ์ ๋ฆฌํ๊ธฐ ์ํ์ฌ order list๋ฅผ ์์ฑํฉ๋๋ค.
order2 = []
for i in range(1,32):
order2.append(str(i))
order2
'''
['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']
'''
# seaborn์ countplot ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์ถ๋ ฅํฉ๋๋ค.
plt.figure(figsize=(20,10))
sns.set(style="darkgrid")
ax = sns.countplot(x="day", data=corona_del_col[corona_del_col['month'] == '8'], palette="rocket_r", order = order2)
[๋ฌธ์ 1] 8์ ํ๊ท ์ผ๋ณ ํ์ง์ ์ ๊ตฌํ๊ธฐ
print(corona_del_col[corona_del_col['month'] == '8']['day'].count()/31)
#77.93548387096774
print(corona_del_col[corona_del_col['month'] == '8']['day'].value_counts().mean())
#77.93548387096774
# 8์ ํ๊ท ํ์ง์ ์๋ฅผ ๊ตฌํ์ฌ quiz_1 ๋ณ์์ ์ ์ฅํฉ๋๋ค. floatํ ์์๊ฐ์ผ๋ก ์ ์ฅํฉ๋๋ค.
quiz_1 = corona_del_col[corona_del_col['month'] == '8']['day'].count()/31
quiz_1 #77.93548387096774
3-4. ์ง์ญ๋ณ ํ์ง์ ์ ์ถ๋ ฅ
corona_del_col['์ง์ญ']
0 ์์ฒ๊ตฌ
1 ๊ฐ๋๊ตฌ
2 ๊ฐ๋จ๊ตฌ
3 ๊ด์
๊ตฌ
4 ๊ด์
๊ตฌ
...
5743 ์ฑ๋ถ๊ตฌ
5744 ๋งํฌ๊ตฌ
5745 ์ข
๋ก๊ตฌ
5746 ์ค๋๊ตฌ
5747 ๊ฐ์๊ตฌ
Name: ์ง์ญ, Length: 5748, dtype: object
์ด๋ฒ์๋ ์ง์ญ๋ณ๋ก ํ์ง์๊ฐ ์ผ๋ง๋ ์๋์ง ๋ง๋๊ทธ๋ํ๋ก ์ถ๋ ฅํด ๋ด ์๋ค.
import matplotlib.font_manager as fm
font_dirs = ['/usr/share/fonts/truetype/nanum', ]
font_files = fm.findSystemFonts(fontpaths=font_dirs)
for font_file in font_files:
fm.fontManager.addfont(font_file)
plt.figure(figsize=(20,10))
# ํ๊ธ ์ถ๋ ฅ์ ์ํด์ ํฐํธ ์ต์
์ ์ค์ ํฉ๋๋ค.
sns.set(font="NanumBarunGothic",
rc={"axes.unicode_minus":False},
style='darkgrid')
ax = sns.countplot(x="์ง์ญ", data=corona_del_col, palette="Set2")
์ง์ญ ์ด์์น ๋ฐ์ดํฐ ์ฒ๋ฆฌ
์์ ์ถ๋ ฅ๋ ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ฉด ์ข ๋๊ตฌ๋ผ๋ ์๋ชป๋ ๋ฐ์ดํฐ์ ํ๊ตญ์ด๋ผ๋ ์ง์ญ๊ณผ๋ ๋ง์ง ์๋ ๋ฐ์ดํฐ๊ฐ ์์์ ์ ์ ์์ต๋๋ค. ๊ธฐ์กด ์ง์ญ ๋ฐ์ดํฐ ํน์ฑ์ ๋ง๋๋ก ์ข ๋๊ตฌ -> ์ค๋๊ตฌ, ํ๊ตญ -> ๊ธฐํ๋ก ๋ฐ์ดํฐ๋ฅผ ๋ณ๊ฒฝํด ๋ด ์๋ค.
# replace ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ํด๋น ๋ฐ์ดํฐ๋ฅผ ๋ณ๊ฒฝํฉ๋๋ค.
# ์ด์์น๊ฐ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐ์ด๊ธฐ์ ์๋ก์ด Dataframe์ผ๋ก ์ ์ฅํฉ๋๋ค.
corona_out_region = corona_del_col.replace({'์ข
๋๊ตฌ':'์ค๋๊ตฌ', 'ํ๊ตญ':'๊ธฐํ'})
# ์ด์์น๊ฐ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐ๋ฅผ ๋ค์ ์ถ๋ ฅํด ๋ด
์๋ค.
plt.figure(figsize=(20,10))
sns.set(font="NanumBarunGothic",
rc={"axes.unicode_minus":False},
style='darkgrid')
ax = sns.countplot(x="์ง์ญ", data=corona_out_region, palette="Set2")
3-5. 8์๋ฌ ์ง์ญ๋ณ ํ์ง์ ์ ์ถ๋ ฅ
# ๋
ผ๋ฆฌ์ฐ์ฐ์ ์ด์ฉํ ์กฐ๊ฑด์ ๋ค์๊ณผ ๊ฐ์ด ์ฌ์ฉํ๋ฉด ํด๋น ์กฐ๊ฑด์ ๋ง๋ ๋ฐ์ดํฐ๋ฅผ ์ถ๋ ฅํ ์ ์์ต๋๋ค.
corona_out_region[corona_del_col['month'] == '8']
# ๊ทธ๋ํ๋ฅผ ์ถ๋ ฅํฉ๋๋ค.
plt.figure(figsize=(20,10))
sns.set(font="NanumBarunGothic",
rc={"axes.unicode_minus":False},
style='darkgrid')
ax = sns.countplot(x="์ง์ญ", data=corona_out_region[corona_del_col['month'] == '8'], palette="Set2")
3-6. ์ ๋ณ ๊ด์ ๊ตฌ ํ์ง์ ์ ์ถ๋ ฅ
# ํด๋น column์ ์ง์ ํ์ฌ series ํํ๋ก ์ถ๋ ฅํ ์ ์์ต๋๋ค.
corona_out_region['month'][corona_out_region['์ง์ญ'] == '๊ด์
๊ตฌ']
3 10
4 10
6 10
7 10
8 10
..
5630 3
5661 2
5674 2
5695 2
5711 2
Name: month, Length: 452, dtype: object
# ๊ทธ๋ํ๋ฅผ ์ถ๋ ฅํฉ๋๋ค.
plt.figure(figsize=(10,5))
sns.set(style="darkgrid")
ax = sns.countplot(x="month", data=corona_out_region[corona_out_region['์ง์ญ'] == '๊ด์
๊ตฌ'], palette="Set2", order = order)
3-7. ์์ธ ์ง์ญ์์ ํ์ง์๋ฅผ ์ง๋ ์์ ์ถ๋ ฅ
# ์ง๋ ์ถ๋ ฅ์ ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ folium์ import ํฉ๋๋ค.
import folium
# Map ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์ง๋๋ฅผ ์ถ๋ ฅํฉ๋๋ค.
map_osm = folium.Map(location=[37.529622, 126.984307], zoom_start=11)
map_osm
#์์ธ์ ํ์ ๊ตฌ์ญ ์๊ตฐ ์ ๋ณด ๋ฐ์ดํฐ๋ฅผ ๋ถ๋ฌ์ ์ฌ์ฉ. CRS์ ์ ์ฅํฉ๋๋ค.
CRS=pd.read_csv("./data/์์ธ์ ํ์ ๊ตฌ์ญ ์๊ตฐ๊ตฌ ์ ๋ณด (์ขํ๊ณ_ WGS1984).csv")
# Dataframe์ ์ถ๋ ฅํด ๋ด
๋๋ค.
CRS
for ๋ฌธ์ ์ฌ์ฉํ์ฌ ์ง์ญ๋ง๋ค ํ์ง์๋ฅผ ์ํ ๋ง์ปค๋ฅผ ์ฌ์ฉํ์ฌ ์ง๋์ ์ถ๋ ฅํด ๋ด ์๋ค.
# corona_out_region์ ์ง์ญ์๋ 'oo๊ตฌ' ์ด์ธ๋ก `ํ์๋`, `๊ธฐํ`์ ํด๋น๋๋ ๋ฐ์ดํฐ๊ฐ ์กด์ฌ ํฉ๋๋ค.
# ์ ๋ฐ์ดํฐ์ ํด๋น๋๋ ์๋, ๊ฒฝ๋๋ฅผ ์ฐพ์ ์ ์๊ธฐ์ ์ญ์ ํ์ฌ corona_seoul๋ก ์ ์ฅํฉ๋๋ค.
corona_seoul = corona_out_region.drop(corona_out_region[corona_out_region['์ง์ญ'] == 'ํ์๋'].index)
corona_seoul = corona_seoul.drop(corona_out_region[corona_out_region['์ง์ญ'] == '๊ธฐํ'].index)
# ์์ธ ์ค์ฌ์ง ์ค๊ตฌ๋ฅผ ๊ฐ์ด๋ฐ ์ขํ๋ก ์ก์ ์ง๋๋ฅผ ์ถ๋ ฅํฉ๋๋ค.
map_osm = folium.Map(location=[37.557945, 126.99419], zoom_start=11)
# ์ง์ญ ์ ๋ณด๋ฅผ set ํจ์๋ฅผ ์ฌ์ฉํ์ฌ 25๊ฐ ๊ณ ์ ์ ์ง์ญ์ ๋ฝ์๋
๋๋ค.
for region in set(corona_seoul['์ง์ญ']):
# ํด๋น ์ง์ญ์ ๋ฐ์ดํฐ ๊ฐ์๋ฅผ count์ ์ ์ฅํฉ๋๋ค.
count = len(corona_seoul[corona_seoul['์ง์ญ'] == region])
# ํด๋น ์ง์ญ์ ๋ฐ์ดํฐ๋ฅผ CRS์์ ๋ฝ์๋
๋๋ค.
CRS_region = CRS[CRS['์๊ตฐ๊ตฌ๋ช
_ํ๊ธ'] == region]
# CircleMarker๋ฅผ ์ฌ์ฉํ์ฌ ์ง์ญ๋ง๋ค ์ํ๋ง์ปค๋ฅผ ์์ฑํฉ๋๋ค.
marker = folium.CircleMarker([CRS_region['์๋'], CRS_region['๊ฒฝ๋']], # ์์น
radius=count/10 + 10, # ๋ฒ์
color='#3186cc', # ์ ์์
fill_color='#3186cc', # ๋ฉด ์์
popup=' '.join((region, str(count), '๋ช
'))) # ํ์
์ค์
# ์์ฑํ ์ํ๋ง์ปค๋ฅผ ์ง๋์ ์ถ๊ฐํฉ๋๋ค.
marker.add_to(map_osm)
map_osm
[๋ฌธ์ 2] 6์์ ํ์ง์๊ฐ ๊ฐ์ฅ ๋ง์ด ๋์จ ์ง์ญ์ ๊ตฌํ์ธ์.
corona_out_region[corona_del_col['month'] == '6']['์ง์ญ'].value_counts()
'''
๊ด์
๊ตฌ 59
๊ตฌ๋ก๊ตฌ 45
์์ฒ๊ตฌ 43
๋๋ด๊ตฌ 43
๊ฐ์๊ตฌ 33
์๋ฑํฌ๊ตฌ 29
ํ์๋ 23
์ํ๊ตฌ 18
๊ธ์ฒ๊ตฌ 17
์์ด๊ตฌ 15
์ค๋๊ตฌ 14
๋์๊ตฌ 13
๋
ธ์๊ตฌ 13
๋งํฌ๊ตฌ 12
์ฉ์ฐ๊ตฌ 12
๊ฐ๋๊ตฌ 11
๊ฐ๋ถ๊ตฌ 10
์ฑ๋๊ตฌ 9
์๋๋ฌธ๊ตฌ 8
๊ฐ๋จ๊ตฌ 7
์กํ๊ตฌ 7
์ฑ๋ถ๊ตฌ 4
๋๋๋ฌธ๊ตฌ 4
์ค๊ตฌ 3
๊ด์ง๊ตฌ 3
์ข
๋ก๊ตฌ 3
๊ธฐํ 2
Name: ์ง์ญ, dtype: int64
'''
top = corona_out_region[corona_del_col['month'] == '6']['์ง์ญ'].value_counts()
top.index[0]
#๊ด์
๊ตฌ
# 6์์ ํ์ง์๊ฐ ๊ฐ์ฅ ๋ง์ด ๋์จ ์ง์ญ์ ๊ตฌํ์ฌ quiz_2 ๋ณ์์ ์ ์ฅํฉ๋๋ค.
# ๋ฌธ์ํ์ผ๋ก ์ ์ฅํฉ๋๋ค.
quiz_2 = top.index[0]
'๊ฐ์ธ๊ณต๋ถ > Python' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
65. Python Numpy ์ฐ์ต๋ฌธ์ (2) (0) | 2021.11.29 |
---|---|
64. NIPA AI์จ๋ผ์ธ ๊ต์ก AI ์ค๋ฌด ๊ธฐ๋ณธ ๊ณผ์ (4)์ฃผ์ ์ ์์ฅ ๋ถ์ (0) | 2021.11.28 |
62. Python Numpy ์ฐ์ต๋ฌธ์ (1) (0) | 2021.11.26 |
61. Python Group & Apply ์ฐ์ต๋ฌธ์ (0) | 2021.11.25 |
60. NIPA AI์จ๋ผ์ธ ๊ต์ก AI ์ค๋ฌด ๊ธฐ๋ณธ ๊ณผ์ (2-2) (0) | 2021.11.24 |