1. Learn
  2. /
  3. 课程
  4. /
  5. Python 抽样

Connected

道练习

系统抽样没问题吗?

系统抽样有一个潜在问题:如果数据已经按某种规则排序,或者行顺序背后存在某种模式或含义,那么得到的样本可能无法代表整体总体。通过打乱行顺序可以解决这个问题,但此时系统抽样就等同于简单随机抽样。

在这里,您将学习如何判断是否存在这个问题。

已提供 attrition_pop;已将 pandas 加载为 pd,matplotlib.pyplot 加载为 plt。

说明 1 / 共 3 个

undefined XP
    1
    2
    3
  • 为 attrition_pop 添加一列索引,将结果赋给 attrition_pop_id。
  • 使用 pandas 的 .plot(),绘制 attrition_pop_id 的 YearsAtCompany 关于 index 的散点图。