← 返回题库
中级

实现资金清算表生成各账户净额汇总

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    account_types_csv = open_url(____).read()
    payment_channels_csv = open_url(____).read()
    accounts_csv = open_url(____).read()
    transfers_csv = open_url(____).read()
    clearing_batches_csv = open_url(____).read()
    channel_stats_csv = open_url(____).read()
    import sqlite3, pandas as pd
    from io import StringIO
    conn = sqlite3.connect(____)
    pd.read_csv(StringIO(____)).to_sql(____)
    sql = "____""____""____"
    result = pd.read_sql_query(____)
    print(result.to_string(____))
    conn.close()

示例

输入
solve()
期望输出
account_id  in_amount  out_amount  net_amount
         13   500000.0         0.0    500000.0
         16    63000.0         0.0     63000.0
          1    36500.0      7000.0     29500.0
         17    25000.0         0.0     25000.0
          2    17000.0      3000.0     14000.0
          6     3000.0         0.0      3000.0
          5    10800.0      9500.0      1300.0
          9        0.0       800.0      -800.0
          3    18000.0     35000.0    -17000.0
          7        0.0     20000.0    -20000.0
         11     2000.0     45000.0    -43000.0
          8        0.0     55000.0    -55000.0
         12        0.0    500000.0   -500000.0
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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