I have lists with numbers in string format and empty spaces. First I want to clear the blanks, and then I want to convert to float. But soon in the first for
the error appears:
if (x [i] == '' or y [i] == ''): IndexError: list index out of range
How is this possible if for
goes to len (x)?
def convert_and_eliminate(x,y):
for i in range(0,len(x)-100):
if (x[i]==''):
x.pop(i)
#y.pop(i)
for i in range(0, len(x) - 1500):
print x[i]
#x[i]=float(x[i])
#y[i]=float(y[i])
for i in range (0,1500):
x.pop()
y.pop()