开始使用免费开始使用

探索基表

在开始构建模型之前,理解您所使用的数据非常重要。本练习将带您学习如何从给定的基表中获取总体规模、目标数量以及目标发生率。

本练习是课程的一部分

Python 预测分析入门

查看课程

练习说明

  • 基表已加载为 pandas 对象 basetable。将行数赋给变量 population_size 并打印。
  • 将等于 1 的目标数量赋给变量 targets_count 并打印。
  • 打印目标发生率,即 targets_countpopulation_size 的比值。

交互式实操练习

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

# Assign the number of rows in the basetable to the variable 'population_size'.
population_size  = ____(____)

# Print the population size.
print(____)

# Assign the number of targets to the variable 'targets_count'.
targets_count = ____(____[____])

# Print the number of targets.
print(____)

# Print the target incidence.
print(____ / ____)
编辑并运行代码