中级
实现作物生长周期积温阶段查询
未完成
中级参考
代码结构已给出,请填写 ____ 处
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 = pd.read_csv(StringIO(____))
stages = pd.read_csv(StringIO(____))
tomato_stages = stages[stages['____']=='____'].sort_values(____)
def determine_stage(____):
accum = ____
for _, s in tomato_stages.iterrows():
accum += float(____)
if cumulative_gdd < accum:
return s['____']
return tomato_stages.iloc[-____]['____']
print(____)
for _, row in gdd.iterrows():
stage = determine_stage(float(____))
match = stage == row['____']
print("____"+str(____)+"____"+str(round(____))+"____"+stage+"____"+str(____)+"____"+str(____))
示例
输入
solve()
期望输出
GDD stage tracking (tomato): 2025-05-19 cumGDD=393.6 stage=vine stored=vine match=True 2025-05-20 cumGDD=405.0 stage=vine stored=flowering match=False 2025-05-21 cumGDD=417.6 stage=vine stored=flowering match=False 2025-05-22 cumGDD=428.9 stage=vine stored=flowering match=False 2025-05-23 cumGDD=439.0 stage=vine stored=flowering match=False 2025-05-24 cumGDD=452.4 stage=flowering stored=flowering match=True 2025-05-25 cumGDD=464.1 stage=flowering stored=flowering match=True 2025-05-26 cumGDD=476.9 stage=flowering stored=flowering match=True 2025-05-27 cumGDD=490.1 stage=flowering stored=flowering match=True 2025-05-28 cumGDD=499.4 stage=flowering stored=flowering match=True 2025-05-29 cumGDD=512.1 stage=flowering stored=flowering match=True 2025-05-30 cumGDD=524.2 stage=flowering stored=flowering match=True 2025-05-31 cumGDD=539.4 stage=flowering stored=flowering match=True 2025-06-01 cumGDD=549.0 stage=flowering stored=flowering match=True
👑
升级 VIP
解锁全部题目,畅通无阻地学习
- ✓ 解锁全部训练包所有题目
- ✓ 查看完整参考代码和提示
- ✓ 浏览器内直接运行 Python 代码
- ✓ 自动批改 + 进度追踪
30天
¥18
1年
¥99
2年
¥158
3年
¥199