开始使用免费开始使用

绘制温度图

在本练习中,您将查看天气数据集中的温度列,以评估这些数据是否可信。您将先打印汇总统计量,然后使用箱线图可视化数据。

判断数值是否合理时,请注意温度单位是华氏度(Fahrenheit),而不是摄氏度(Celsius)!

本练习是课程的一部分

使用 pandas 分析警务活动

查看课程

练习说明

  • weather.csv 读入为名为 weather 的 DataFrame。
  • 选择温度列(TMINTAVGTMAX),并使用 .describe() 方法打印它们的汇总统计量。
  • 创建箱线图以可视化这些温度列。
  • 显示图表。

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Read 'weather.csv' into a DataFrame named 'weather'


# Describe the temperature columns
print(____)

# Create a box plot of the temperature columns
____.plot(kind='box')

# Display the plot
编辑并运行代码