← 返回题库
中级

统计各类型维修工单平均完成时长

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    from io import StringIO
    import pandas as pd
    tasks=pd.read_csv(StringIO(open_url(____).read()))
    fixed_tasks=tasks[tasks['____']=='____'].copy()
    fixed_tasks['____']=(pd.to_datetime(____)-pd.to_datetime(____)).dt.total_seconds()/____
    print(____)
    print(____)
    print(____)
    for rtype,grp in fixed_tasks.groupby(____):
        print(____)

示例

输入
solve()
期望输出
Completed tasks: 53
Avg repair time: 43.4 hours
By repair_type:
  充电/换电: avg=41.4h count=7
  更换内胎: avg=56.8h count=8
  焊接/更换车架: avg=42.2h count=13
  维修车锁: avg=39.9h count=8
  调整刹车: avg=40.0h count=11
  重置仪表盘: avg=41.7h count=6
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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