水文预报三层蒸发模型与径流划分python程序

"""

import pandas as pd
import math

# 设定初始值
WUM = 20
WLM = 60
WDM = 40
b = 0.3
C = (1 / 6)
FC = 2.5
WM = WUM + WLM + WDM
WMM = WM * (1 + b)

# 读取原始数据
df = pd.read_csv("10月.csv", index_col='月份')
df = df.fillna(0)

for i in range(1, len(df) + 1):

# 计算WU,WL,WD
if i == 1:
df["WU"][i] = WUM
df["WL"][i] = WLM
df["WD"][i] = WDM


else:
dw = df["PE"][i - 1] - df['R'][i - 1]
df["WU"][i] = df["WU"][i - 1] + dw
df["WL"][i] = df["WL"][i - 1]
df["WD"][i] = df["WD"][i - 1]
if df["WU"][i] < 0:
df["WL"][i] = df["WL"][i - 1] + df["WU"][i]
df[&

你可能感兴趣的:(python,pandas,数据分析)