I reading a CSV file with pd.read_csv, as shown:
lisp = pd.read_csv('ida_lisp.ida', header=None, skip_blank_lines=False)
I replace %1% with key values and save the result to different locations, as shown:
heating_setpoint_s = [19, 20, 21, 22, 23, 24]
for i in range(len(heating_setpoint_s)):
lisp1 = lisp.replace('%1%', str(heating_setpoint_s[i]), regex=True)
path = "C://Users//nico//"+str(i+1)+"_ida"
os.chdir(path)
lisp1.to_csv('ida_lisp.ida', header=False, index=False, na_rep=" ")
All is working fine for the exception of one line MDESIGN "" in the old CSV file:
K2 0.0
TAU 1.0
SPECPUMPPO 349.0
MDESIGN ""
MODULE chil
TYPE SIMCHIL
NFPLR 0
COP 3
is changed after saving, to:
K1 0.0
K2 0.0
TAU 1.0
SPECPUMPPO 349.0
" MDESIGN """""
MODULE chil
TYPE SIMCHIL
NFPLR 0
COP 3
Does anyone know how to prevent this?