开始使用免费开始使用

均值与中位数

汇总统计顾名思义,就是用一个统计量来概括一组数。例如,均值、中位数、最小值、最大值和标准差都是常见的汇总统计。计算汇总统计可以帮助您快速把握数据特点,即使数据量很大也不例外。

sales 已提供,并且已将 pandaspd 加载。

本练习是课程的一部分

使用 pandas 进行数据处理

查看课程

练习说明

  • 先探索这个新的 DataFrame,打印 sales 的前几行。
  • 打印 sales 中各列的信息。
  • 打印 weekly_sales 列的均值。
  • 打印 weekly_sales 列的中位数。

交互式实操练习

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

# Print the head of the sales DataFrame
print(____)

# Print the info about the sales DataFrame
print(____)

# Print the mean of weekly_sales
print(____)

# Print the median of weekly_sales
print(____)
编辑并运行代码