I want to write the contents of lists on a text file. The way I currently do it is the following:
for k in li:
outp.write(str(k))
out.write('\n')
however, this is taking a long time to run (I have tens of millions of lines)
Is there any faster way?
Sample Lines
The lists are from a sparse matrix so there are plenty of zeros. The non null elements are ones only
eg of such a list: [0 0 0 0 0 0 0 1 0 0 1 1 1 0 0]
The numbers are separated by tabs