0
I have lists with numbers in string format and empty spaces. First I want to take the empty spaces, and then I want to convert to float. But right on the first for
error appears:
if (x[i]=='' or y[i]==''): Indexerror: list index out of range
How is that possible if the 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()
Give an example (minimum possible) of what you could have
x
and iny
, 'Cause the range goes uplen(x)-100
?– Sidon