可视化蛇形图
做得很好!现在请使用熔化后的数据集来绘制蛇形图。熔化后的数据已加载为 datamart_melt。
seaborn 库已加载为 sns,matplotlib.pyplot 可通过 plt 使用。
您可以使用控制台来探索该熔化数据集。
本练习是课程的一部分
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()