← 返回题库
中级

分析取消订餐时间分布

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    from io import StringIO
    import pandas as pd
    orders=pd.read_csv(StringIO(open_url(____).read()))
    cancelled=orders[orders['____']=='____'].dropna(____).copy()
    cancelled['____']=(cancelled['____'].astype(____)//____%____).astype(____)
    by_hour=cancelled.groupby(____).size().reset_index(____)
    mx=by_hour['____'].max() if len(____)>____ else ____
    print(____)
    for _,r in by_hour.iterrows():
        bar='____'*int(____)
        print(____)

示例

输入
solve()
期望输出
Cancel time distribution by hour:
  13:xx: xxxxxxxxxxxxxxx 176
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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