← 返回题库
中级

检测生成卡片中的重复项

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    from io import StringIO
    import pandas as pd
    results=pd.read_csv(StringIO(open_url(____).read()))
    cards=pd.read_csv(StringIO(open_url(____).read()))
    def is_duplicate(____):
        front_lower=str(____).lower().strip()
        for ef in existing_fronts:
            if str(____).lower().strip()==front_lower: return True
        return False
    existing_fronts=list(____)
    dupes=____; checked=____
    for _,r in results.head(____).iterrows():
        checked+=____
        if is_duplicate(____): dupes+=____
    print(____)
    print(____)

示例

输入
solve()
期望输出
Duplicate detection (first 50 results):
  Checked: 50 | Duplicates: 0 (0.0%)
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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