← 返回题库
中级

实现作物生长积温GDD累计计算

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    from io import StringIO
    import pandas as pd
    gdd_csv = open_url(____).read()
    stages_csv = open_url(____).read()
    gdd_data = pd.read_csv(StringIO(____))
    stages = pd.read_csv(StringIO(____))
    T_BASE_TOMATO = ____
    def calc_daily_gdd(____):
        return max(____, (____) / ____ - t_base)
    print(____)
    for _, row in gdd_data.tail(____).iterrows():
        daily = calc_daily_gdd(____)
        cumgdd = row['____']
        print("____"+str(____)+"____"+str(____)+"____"+str(____)+"____"+str(round(____))+"____"+str(round(____))+"____"+str(____))
    stage_req = stages[stages['____']=='____'][['____','____']]
    print(____)
    for _, s in stage_req.iterrows():
        print("____"+s['____']+"____"+str(____)+"____")

示例

输入
solve()
期望输出
GDD accumulation (tomato, T_base=10):
  2025-05-26 t_max=31.8 t_min=13.6 daily=12.7 cumulative=476.85 stage=flowering
  2025-05-27 t_max=30.2 t_min=16.2 daily=13.2 cumulative=490.05 stage=flowering
  2025-05-28 t_max=25.1 t_min=13.6 daily=9.35 cumulative=499.4 stage=flowering
  2025-05-29 t_max=31.0 t_min=14.4 daily=12.7 cumulative=512.1 stage=flowering
  2025-05-30 t_max=28.3 t_min=15.9 daily=12.1 cumulative=524.2 stage=flowering
  2025-05-31 t_max=31.9 t_min=18.4 daily=15.15 cumulative=539.35 stage=flowering
  2025-06-01 t_max=26.3 t_min=13.0 daily=9.65 cumulative=549.0 stage=flowering
Stage GDD requirements:
  seedling: 150.0 GDD
  vine: 300.0 GDD
  flowering: 200.0 GDD
  fruiting: 400.0 GDD
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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