Im having some problem with a list of ints, it looks like this:
Its part of a bigger list, but when I try to go thru it line by line and parse it I get the following error:
ValueError: invalid literal for int() with base 10: '\xef\xbb\xbf85\n'
My code looks like:
with open("data.csv", "r") as ins:
array = []
for line in ins:
print 'String: ', line
print 'Integer: ', int(line)
If I try to catch the error with this code:
with open("data.csv", "r") as ins:
array = []
for line in ins:
print 'String: ', line
try:
print 'Integer: ', int(line)
except:
print 'Non-integer: ', line
I get this output:
Anyone have a clue?