← 返回题库
中级

SPC极差控制图R-chart

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    import pandas as pd
    import numpy as np
    import matplotlib.pyplot as plt
    url = '____'
    df = pd.read_csv(____)
    sample_cols = [f'____' for i in range(____,____)]
    R = df[sample_cols].max(____) - df[sample_cols].min(____)
    R_bar = R.mean()
    D3, D4 = ____, ____
    UCL = D4*R_bar
    LCL = D3*R_bar
    print(____)
    plt.figure(figsize=(____,____))
    plt.plot(____)
    plt.axhline(____)
    plt.axhline(____)
    plt.axhline(____)
    plt.xlabel(____); plt.ylabel(____); plt.title(____)
    plt.legend(); plt.tight_layout(); plt.show()

示例

输入
solve()
期望输出
CL=0.0389,UCL=0.0780,LCL=0.0000
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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