Data Preprocess & EDA(4) - Data Visualization
2021. 1. 30. 10:26ㆍ[AI]/Data Science Fundamentals
<Learned Stuff>
Key Points
-
Data Visualization
-
데이터 시각화를 통해 Trend 파악 & Insight 얻음
- matplotlib (수동작업)
- seaborn (자동작업)
- plotly(interactive)
-
Palette
-
Labeling
-
Facet Grid
-
<New Stuff>
[Palette]
- 그래프의 색깔을 변환해줌 (지정해주지 않으면 자동 지정)
[Labeling]
graph = sns.barplot(x,y,data)
graph.set_xlabel("x축",weight='bold',fontsize='12)
graph.set_ylabel("y축",weight='bold',fontsize='12)
graph.set_title("제목",weight='bold',fontsize='12)
==> 지정해줄 수 있음!
[FacetGrid]
- 그래프를 나누어서 표현 가능!
ex) titanic.csv
g = sns.FacetGrid(data=titanic,col='survived') # survived로 나누어서 그래프를 그리겠다란 의미
g = g.map(
sns.countplot,
"embark_town",
palette='coolwarm',
order = titanic['embark_town'].value_counts().index);
# order 지정 안해주면 잘못된 그림이 나올 수 있음
# 필요하다면 sorted() 함수 넣을 것!
g.set_axis_labels("Embark Town", "Counts", weight ='bold',fonsize=12);
728x90
'[AI] > Data Science Fundamentals' 카테고리의 다른 글
Data Preprocess & EDA(2) - Feature Engineering (0) | 2021.01.30 |
---|---|
Data Preprocess & EDA(3) - Data Manipulation (0) | 2021.01.30 |
Statistic(1) - Hypothesis Test(1) (0) | 2021.01.30 |
Statistic(2) - Hypothesis Test(2) (0) | 2021.01.30 |
Statistic(3) - Confidence Level (0) | 2021.01.30 |