用箱线图描述时间序列数据
在分析时,您应当始终先查看变量的分布。由于这里处理的是时间序列数据,您将通过箱线图和数值摘要来探索其特性。提醒一下,您可以用以下命令将 DataFrame 绘制为箱线图:
df.boxplot(fontsize=6, vert=False)
请注意新增参数 vert,它用来指定箱线图是水平绘制还是垂直绘制。
本练习是课程的一部分
用 Python 可视化时间序列数据
练习说明
- 为
jobs中的所有时间序列生成箱线图。 - 打印
jobs中所有时间序列的数值统计摘要。 - 查看结果,并打印均值最高以及变异性最大(即标准差最高)的时间序列名称。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Generate a boxplot
____.____(fontsize=6, vert=False)
plt.show()
# Generate numerical summaries
print(____)
# Print the name of the time series with the highest mean
print(____)
# Print the name of the time series with the highest variability
print(____)