← 返回题库
中级

统计各用户小票解析成功率

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    from io import StringIO
    import pandas as pd
    rcp = pd.read_csv(StringIO(open_url(____).read()))
    users = pd.read_csv(StringIO(open_url(____).read()))
    by_user = rcp.groupby(____).agg(total=(____),success=('____',lambda x:(____).sum()),avg_conf=(____)).reset_index()
    by_user['____'] = (____).round(____)
    merged = by_user.merge(____)
    print(____)
    for _, row in merged.nlargest(____,'____').iterrows():
        print(____)

示例

输入
solve()
期望输出
User OCR success rates:
  蒋欣: total=13 rate=53.8% conf=0.632
  周婷: total=11 rate=72.7% conf=0.637
  高洁: total=10 rate=50.0% conf=0.58
  邓帅: total=10 rate=50.0% conf=0.558
  胡萍: total=9 rate=44.4% conf=0.545
  林峰: total=9 rate=55.6% conf=0.657
  宋雪: total=9 rate=44.4% conf=0.617
  曹云: total=9 rate=22.2% conf=0.586
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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