抽样分布 vs. 自助法分布
抽样分布与自助法分布关系紧密。在可以反复从总体中抽样(这种情况并不常见)时,先后生成抽样分布和自助法分布,有助于看到它们之间的联系。
这里,您关心的统计量是歌曲 popularity(流行度)得分的均值。
已提供 spotify_population(完整数据集)和 spotify_sample(从 spotify_population 随机抽取的 500 行);pandas 和 numpy 已按常用别名加载。
本练习是课程的一部分
Python 抽样
交互式实操练习
通过完成这段示例代码来试试这个练习。
mean_popularity_2000_samp = []
# Generate a sampling distribution of 2000 replicates
____:
mean_popularity_2000_samp.append(
# Sample 500 rows and calculate the mean popularity
____
)
# Print the sampling distribution results
print(mean_popularity_2000_samp)