aditya shukla wrote:
(I'm sure you mean "a question"; in english, "a doubt" is something
slightly different, and quite often more negative.)
print repr(line) # added for debugging!
one or more lines in your file doesn't match the description; try adding
a print statement (see above) to see what they might look like, and make
sure that you filter them out (e.g. by checking the size of the list you
get from the split, as Terry explains).
</F>
Guys thanks for your previous help .I have a doubt again
slightly different, and quite often more negative.)
Also , because of this i am not able to extract the floating point
values ie 0.50,0.50,0.66 respectively
cause when i use the proposed solution given earlier
>
data=[]
for line in x:
values ie 0.50,0.50,0.66 respectively
cause when i use the proposed solution given earlier
>
data=[]
for line in x:
line=line.split ("|")
data.append(flo at(line[-2])) --i am trying to get the floating
point values from the back
>
i receive this error message
>
Traceback (most recent call last):
File "<pyshell#7 1>", line 3, in <module>
d.append(float( line[-2]))
IndexError: list index out of range
data.append(flo at(line[-2])) --i am trying to get the floating
point values from the back
>
i receive this error message
>
Traceback (most recent call last):
File "<pyshell#7 1>", line 3, in <module>
d.append(float( line[-2]))
IndexError: list index out of range
a print statement (see above) to see what they might look like, and make
sure that you filter them out (e.g. by checking the size of the list you
get from the split, as Terry explains).
</F>