<div dir="ltr"><div><div><div><div>In the programme below I am trying to read two csv format files and process them and write a new file with some of theirs data.<br><br>import csv<br>f1_reader = csv.reader(open(r"Z:\Weka work\Feature_Vectors_Fullset_00.arff"))<br>
f2_reader = csv.reader(open(r"Z:\Weka work\Feature_Vectors_Fullset_00_noxy+class.arff"))<br>nf = open(r"Z:\Weka work\classified_image00_withoutxy.arff", "w")<br><br>while True:<br> l1 = f1_reader.next()<br>
while len(l1) != 12:<br> l1 = f1_reader.next()<br> l2 = f2_reader.next()<br> while len(l2) != 11:<br> l2 = f2_reader.next()<br><br> ix = l1[0].strip()<br> iy = l1[1].strip()<br> classification = l2[8].strip()<br>
<br> print >> nf, ix, iy, classification<br><br>nf.close()<br><br></div>This programme is giving me this error now : <br><br>Traceback (most recent call last):<br> File "Z:\Weka work\final_image_classificationwithoutxy.py", line 16, in <module><br>
l2 = f2_reader.next()<br>StopIteration<br><br><br></div>what could be a possible reason to StopIteration ??? <br><br><br></div>I checked the syntax and usage of this module looks alright to me , but then why this error ?<br>
<br><br></div>Thankyou in Advance <br></div>