探索模式

用 Python 提升数据可视化

Nick Strayer

Instructor

更深入地挖掘

  • 调查相关性
  • 相关性是否由混杂因素驱动?
  • 有什么意外发现?

一把铲子挖入地面

用 Python 提升数据可视化

目标受众

  • 与同事分享
  • 审慎做设计决策
  • 记住他们不如你熟悉数据

卡通人物向同事做通用演示

用 Python 提升数据可视化
sns.regplot('NO2', 'CO', ci=False, data=pollution,

# Lower opacity of points scatter_kws={'alpha':0.2, 'color':'grey'} )

NO2 与 CO 污染值的散点图,并绘有基本拟合线

用 Python 提升数据可视化

模式剖析

  • 发现了有趣的模式
  • 如何快速探索并解释?
  • 用文本!

无标签散点图中两组明显簇

用 Python 提升数据可视化

用文本散点识别离群点

丹佛平均 SO2 与 CO 的散点图,右上角有明显离群点

带标注的丹佛平均 SO2 与 CO 散点图,右上角的明显离群点为 1 月

用 Python 提升数据可视化
g = sns.scatterplot("SO2","CO", data=long_beach_avgs)

# Iterate over the rows of our data
for _, row in long_beach_avgs.iterrows():
    # Unpack columns from row
    month, SO2, CO = row

# Draw annotation in correct place g.annotate(month, (SO2,CO))
plt.title('Long Beach avg SO2 by CO')
用 Python 提升数据可视化

长滩市各月份平均 SO2 与 CO 的带标注散点图

用 Python 提升数据可视化

开始深入

用 Python 提升数据可视化

Preparing Video For Download...