← 返回题库
中级

实现土壤EC读数温度补偿校正

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    from pyodide.http import open_url
    from io import StringIO
    import pandas as pd
    st_csv = open_url(____).read()
    st = pd.read_csv(StringIO(____))
    ec_st = st[st['____']=='____']
    TEMP_COEFF = ____
    STD_TEMP = ____
    def compensate_ec(____):
        ec_corrected = ec_raw / (____ + TEMP_COEFF * (____))
        return round(____)
    test_cases = [
        (____, ____),(____, ____),(____, ____),(____, ____),(____, ____),
    ]
    print(____)
    for ec_raw, temp in test_cases:
        ec_corr = compensate_ec(____)
        diff = round(____)
        print("____" + str(____) + "____" + str(____) + "____" + str(____) + "____" + str(____))

示例

输入
solve()
期望输出
EC temperature compensation (coeff=0.02):
  EC_raw=2.1 T=25.0C -> EC_corr=2.1 diff=0.0
  EC_raw=2.1 T=15.0C -> EC_corr=2.625 diff=0.525
  EC_raw=2.1 T=35.0C -> EC_corr=1.75 diff=-0.35
  EC_raw=3.5 T=20.0C -> EC_corr=3.889 diff=0.389
  EC_raw=1.5 T=30.0C -> EC_corr=1.364 diff=-0.136
Python 代码 🔒 登录后使用
🔒

登录后即可练习

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