← 返回题库
中级

基于decision_log检测通过率异常预警

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    from io import StringIO
    loans_featured_csv = open_url(____).read()
    realtime_requests_csv = open_url(____).read()
    blacklist_csv = open_url(____).read()
    decision_log_csv = open_url(____).read()
    import pandas as pd
    from io import StringIO
    df = pd.read_csv(StringIO(____))
    df['____']=pd.to_datetime(____)
    df=df.sort_values(____)
    overall_mean=df['____'].mean()
    recent7=df.tail(____)
    recent_mean=recent7['____'].mean()
    deviation=abs(____)/overall_mean
    print(____)
    print(recent7[['____','____','____']].to_string(____))
    print(____)
    print(____)
    print(____)
    print(____)
    status='____' if deviation>____ else '____'
    print(____)

示例

输入
solve()
期望输出
最近7天通过率监控:
apply_date  through_rate  avg_score
2026-03-30        0.7223      631.7
2026-03-31        0.7244      610.1
2026-04-01        0.7405      634.4
2026-04-02        0.7067      614.9
2026-04-03        0.6864      628.1
2026-04-04        0.6905      608.1
2026-04-05        0.6790      611.2

整体均值: 0.7170
近7日均值: 0.7071
偏差: 0.0139
预警状态: 正常
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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