I have a 30 n random sample from a list which I write to a file.
I would rather like to tag the lines that went to the sample by writing in the end "in_sample" or "not_in_sample".
Now it looks like this:
mysample=random.sample(list, 30)
for i in mysample:
out.write("%s\n" % (i))
I only write out lines from the sample but I would want the file to look like this:
line 1 in_sample
line 2 not_in_sample
line 3 in_sample
line 4 not_in_sample
The file looked the same before but without the last column.
Am I clear?