If I write
f = open("file.csv","r")
if f.mode == "r":
cols = []
snames = []
svals = []
rows = f.readlines()
for x in rows:
x.strip("\n")
cols = x.split(",")
snames.append(cols[0])
svals.append(cols[1])
then svals still has the \n characters I dont want e.g. '20.43256639\n'
but if I do this instead, then svals shows the correct values without the \n
for x in rows:
cols = x.split(",")
snames.append(cols[0])
svals.append(cols[1].strip("\n"))
svals DOES have the right values e.g. '20.43256639'