import pandas as pd
for day inrange(21):
gendata = pd.read_csv("gen\\case39_day_"+str(day)+"_gen.csv", header=None, index_col=None)
maxdata = pd.read_csv("max_renewable_gen_p\\case39_day_"+str(day)+"_max_renewable_gen_p.csv", header=None,
index_col=None)print("The day {} has began!".format(day))for i inrange(gendata.shape[0]):for j inrange(gendata.shape[1]):if gendata.iloc[i, j]> maxdata.iloc[i, j]:print("The {} day is over, in {}, {}, the orignal is {}, the real max is {}".format(day, i, j,
gendata.iloc[i, j],
maxdata.iloc[i, j]))
gendata.iloc[i, j]= maxdata.iloc[i, j]
gendata.to_csv("gen\\case39_day_"+str(day)+"_gen.csv", header=None, index_label=None, columns=None, index=None)print("The day {} has corrected over!".format(day))