스네이크 플롯 시각화
잘하셨습니다! 이제 melt된 데이터셋을 사용해 스네이크 플롯을 만들어 보겠습니다. melt된 데이터는 datamart_melt로 불러와져 있습니다.
seaborn 라이브러리는 sns로, matplotlib.pyplot은 plt로 제공됩니다.
콘솔을 사용해 melt된 데이터셋을 탐색해 보세요.
이 연습은 강의의 일부입니다
Python을 활용한 고객 세분화
연습 안내
- 플롯 제목을 추가하세요.
- X축 레이블 "Metric"을 추가하세요.
- Y축 레이블 "Value"를 추가하세요.
datamart_melt의Cluster값마다 하나의 선을 그리세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Add the plot title
plt.____('Snake plot of normalized variables')
# Add the x axis label
plt.____('____')
# Add the y axis label
plt.____('____')
# Plot a line for each value of the cluster variable
sns.____(____=____, x='____', y='____', hue='____')
plt.show()