Seaborn

R 사용자용 Python

Daniel Chen

Instructor

Seaborn

  • 막대 그래프: barplot
  • 히스토그램: histplot
  • 박스 플롯: boxplot
  • 산점도: regplot
  • Seaborn 장점
    • 데이터별 색상 구분
    • 데이터별 패싯 플롯
R 사용자용 Python

Seaborn 히스토그램

import seaborn as sns
import matplotlib.pyplot as plt
sns.histplot(iris['sepal_length'], kde = True)
plt.show()

R 사용자용 Python

Seaborn 카운트 플롯

sns.countplot('species', data=iris)
plt.show()

R 사용자용 Python

Seaborn 박스 플롯

sns.boxplot(x='species', y='sepal_length', data=iris)
plt.show()

R 사용자용 Python

Seaborn 산점도

sns.regplot(x='sepal_length', y='sepal_width', data=iris)
plt.show() 

R 사용자용 Python

회귀선 없는 Seaborn 산점도

sns.regplot(x='sepal_length', y='sepal_width', data=iris,
            fit_reg=False)
plt.show()

R 사용자용 Python

Seaborn 패싯

sns.lmplot(x='sepal_length', y='sepal_width', data=iris,
           fit_reg=False,
           col='species')
plt.show() 

R 사용자용 Python

Seaborn FacetGrid

g = sns.FacetGrid(iris, col="species")
g = g.map(plt.hist, "sepal_length")
plt.show()

R 사용자용 Python

연습해 봅시다!

R 사용자용 Python

Preparing Video For Download...