Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
Tags
- c++
- ๋ฐ์ดํฐ๋ถ์
- ์ํ์ฝ๋ฉ
- ๋ค์ดํฐ๋ธ
- ํ๊ตญ์ด์๋ฒ ๋ฉ
- ์ธํ๋ฐ
- linearalgebra
- ๋ถ์
- ํ์ดํ๋
- ๋ฅ๋ฌ๋
- ๊ฒฐ์ ํธ๋ฆฌ
- ๋จธ์ ๋ฌ๋
- Titanic
- ์ ํ๋์ํ
- ๋ฐฑ์ค
- ๋์
- ๋ฐ์ดํฐ
- cs231n
- ๊นํ
- ์๋๋ก์ด๋์คํ๋์ค
- native
- ๋ฆฌ์กํธ
- AI
- react
- nlp
- ์๊ณ ๋ฆฌ์ฆ
- Git
- ์๋ฒ ๋ฉ
- Kaggle
- ๋ฐ์ดํฐ์๊ฐํ
Archives
- Today
- Total
yeon's ๐ฉ๐ป๐ป
[ํ๋์ฐจ์ด์ฆ ์ ์ ๋ถ์] countplot, scatterplot, jointplot ๋ณธ๋ฌธ
Computer ๐ป/๋ฐ์ดํฐ ๋ถ์
[ํ๋์ฐจ์ด์ฆ ์ ์ ๋ถ์] countplot, scatterplot, jointplot
yeon42 2021. 8. 5. 16:42728x90
8.2 ๋ฒ์ฃผํ ๊ฐ์ผ๋ก countplot ๊ทธ๋ฆฌ๊ธฐ
- '๋ธ๋๋'๋ช ์ ๋น๋์ ๊ตฌํ๊ธฐ
brand_count = df_31["๋ธ๋๋๋ช
"].value_counts()
df_31["๋ธ๋๋๋ช
"].value_counts().plot.barh()
- normalize=True๋ก ๋น๋์์ ๋น์จ ๊ตฌํ๊ธฐ
df_31["๋ธ๋๋๋ช
"].value_counts(normalize=True).plot.barh()
- countplot ๊ทธ๋ฆฌ๊ธฐ
g = sns.countplot(data=df_31, x="๋ธ๋๋๋ช
")
g.text(x=0, y=brand_count[0], s=brand_count[0])
g.text(x=1, y=brand_count[1], s=brand_count[1])
g = sns.countplot(data=df_31, x="๋ธ๋๋๋ช
")
for i, value in enumerate(brand_count.index):
g.text(x=i, y=brand_count[i], s=brand_count[i])
- x๋ x์ถ์ ์ขํ, y๋ y์ถ์ ์ขํ์ด๋ฉฐ, s๋ ์ถ๋ ฅํ๊ณ ์ ํ๋ ๋ฌธ์
- ์๊ตฐ๊ตฌ๋ช ์ผ๋ก ๋น๋์ ์ธ๊ณ , ๋ธ๋๋๋ช ์ผ๋ก ์์ ๋ค๋ฅด๊ฒ ํํํ๋ countplot
plt.figure(figsize=(15, 4))
g = sns.countplot(data=df_31, x="์๊ตฐ๊ตฌ๋ช
", hue="๋ธ๋๋๋ช
")
- ๋์ฒด์ ์ผ๋ก ๋ฐฐ์คํจ๋ผ๋น์ค์ ๋งค์ฅ์ด ๋ ๋ง๋ค.
8.3 scatterplot ๊ทธ๋ฆฌ๊ธฐ
- pandas์ scatterplot
df_31[["์๋", "๊ฒฝ๋"]].plot.scatter(x="๊ฒฝ๋", y="์๋")
- hue ์ง์
sns.scatterplot(data=df_31, x="๊ฒฝ๋", y="์๋", hue="๋ธ๋๋๋ช
")
- jointplot
sns.jointplot(data=df_31, x="๊ฒฝ๋", y="์๋")
- jointplot : scatterplot๊ณผ histogram์ ํจ๊ฒ ๊ทธ๋ ค์ค
- ๊ฒฝ๋, ์๋ ๋ฐ์ดํฐ๋ ์ด๋์ ๋ ๋น๋์๊ฐ ๋ง์์ง ํ๋จ ๊ฐ๋ฅ
sns.jointplot(data=df_31, x="๊ฒฝ๋", y="์๋", kind="hex")
- ๋น๋์์ ๋ฐ๋ผ ์์ด ์งํ๊ณ ์ ์์ ๋ํ๋ด ์์ ๋ง๊ณ ์ ์์ ์ ์ ์๋ค.
'Computer ๐ป > ๋ฐ์ดํฐ ๋ถ์' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋์ฐจ์ด์ฆ ์ ์ ๋ถ์] *์์ฝ (0) | 2021.08.07 |
---|---|
[ํ๋์ฐจ์ด์ฆ ์ ์ ๋ถ์] Folium | MarkerCluster (0) | 2021.08.05 |
[ํ๋์ฐจ์ด์ฆ ์ ์ ๋ถ์] ํน์ ์ํธ๋ง ์ถ์ถ (0) | 2021.08.05 |
[ํ๋์ฐจ์ด์ฆ ์ ์ ๋ถ์] ์ ์ฒ๋ฆฌ ํ์ผ ์ ์ฅํ๊ธฐ (0) | 2021.08.05 |
[๋ฐ์ดํฐ ๋ถ์] Folium | ์ง๋ ํ์ฉํ๊ธฐ (0) | 2021.08.04 |
Comments