← 返回题库
中级

实现OCR批量入库流程

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    from io import StringIO
    import pandas as pd
    rcp = pd.read_csv(StringIO(open_url(____).read()))
    BATCH_SIZE = ____
    total_a = total_r = total_x = ____
    for i in range(____, len(____), BATCH_SIZE):
        batch = rcp.iloc[i:i+BATCH_SIZE]
        a = len(____)
        r = len(batch[(____)&(____)])
        x = len(____)
        print(____)
        total_a+=a; total_r+=r; total_x+=x
    print(____)

示例

输入
solve()
期望输出
Batch 1: accepted=2 review=14 rejected=34
  Batch 2: accepted=4 review=10 rejected=36
  Batch 3: accepted=4 review=9 rejected=37
  Batch 4: accepted=4 review=13 rejected=33
Total: accepted=14 review=46 rejected=140
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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