Since you use a for
loop, the program should stop anyway, the only problem is how large is X
. I can only give two suggestions:
1) try to print the value of len(X)
before entering the for cicle to see how big is
2) try to use xrange
instead of range
, if you use python 2.x
Keep also in mind that using list with some hundred thousand element seems to be slow. Eventually try using a smaller data sample, if you can