← 返回题库
中级

实现账单流水去重检测

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    from io import StringIO
    import pandas as pd
    txs = pd.read_csv(StringIO(open_url(____).read()))
    WINDOW = ____
    dupes = []
    rows = txs.sort_values(____).to_dict(____)
    for i in range(len(____)-____):
        a,b = rows[i],rows[i+____]
        if (a['____']==b['____'] and a['____']==b['____'] and
            abs(float(____)-float(____))<____ and abs(int(____)-int(____))<WINDOW):
            dupes.append(____)
    print(____)
    for d in dupes[:____]: print(____)

示例

输入
solve()
期望输出
Total: 250 | Duplicates: 0
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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