728x90
반응형
FaceGrid()
행과 열에 데이터 별로 상관관계를 시각화해준다.
import matplotlib.pyplot as plt
import seaborn as sns
# Seaborn 제공 데이터셋 가져오기
titanic = sns.load_dataset('titanic')
# 스타일 테마 설정 (5가지: darkgrid, whitegrid, dark, white, ticks)
sns.set_style('whitegrid')
# 조건에 따라 그리드 나누기
g = sns.FacetGrid(data=titanic, col='who', row='survived',margin_titles=True)
# 그래프 적용하기
g = g.map(plt.hist, 'age')
pairplot()
scatter, kde, hist, reg 그래프로 데이터프레임 컬럼 간의 관계를 시각화해준다.
import matplotlib.pyplot as plt
import seaborn as sns
# Seaborn 제공 데이터셋 가져오기
titanic = sns.load_dataset('titanic')
# 스타일 테마 설정 (5가지: darkgrid, whitegrid, dark, white, ticks)
sns.set_style('whitegrid')
# titanic 데이터셋 중에서 분석 데이터 선택하기
titanic_pair = titanic[['age','pclass', 'fare']]
# 조건에 따라 그리드 나누기
g = sns.pairplot(titanic_pair)
728x90
반응형
'Python 파이썬 > seaborn' 카테고리의 다른 글
seaborn ) 2개의 연속형 데이터의 분포 시각화 (0) | 2022.03.30 |
---|---|
seaborn ) 단변수 데이터의 분포 그래프 (0) | 2022.03.30 |
seaborn ) 범주형 데이터의 분포 시각화 (0) | 2022.03.29 |
seaborn ) 막대 그래프 (0) | 2022.03.28 |
seaborn ) 소개 (0) | 2022.03.28 |
댓글