I have a csv file and I am trying to plot some of the contents and need to convert the strings to floats. My problem is the following:
When I run the code below,
with open('meteors.csv', 'rU') as csvfile:
reader=csv.reader(csvfile)
for row in reader:
print row[6]
I get this output:
58.58333
When I instead try
print type(row[6])
I get this output:
<type 'str'>
But when I try
print float(row[6])
I get this error:
ValueError: could not convert string to float: coordinate_1
Anyone know what's going on?
stringsuch as\n,\tetc...?repr(s)print(repr(row[6]))and it should print out the rawstringshowing all terminating characters