← 返回题库
中级

Bootstrap方法

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    import numpy as np
    np.random.seed(____)
    data = [____,____,____,____,____,____,____,____,____,____]
    n_bootstrap = ____
    means = []
    for _ in range(____):
        sample = np.random.choice(data, size=len(____), replace=True)
        means.append(np.mean(____))
    lower = np.percentile(____)
    upper = np.percentile(____)
    print(____)
    print(____)

示例

输入
solve()
期望输出
3.70
7.30
Python 代码 🔒 登录后使用
🔒

登录后即可练习

注册免费账号,在浏览器中直接运行 Python 代码