File size: 575 Bytes
2cb73a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import random

fp = open("train.csv")

exs = []

for line in fp:
    exs.append(line.strip())
fp.close()
'''
fp = open("old/train.csv")

old_exs = []

for line in fp:
    old_exs.append(line.strip())
fp.close()

exs = [ex for ex in exs if ex in old_exs]
'''
fp = open("train_20.csv")

exs_20 = []

for line in fp:
    exs_20.append(line.strip())
fp.close()
print("Train: ", str(len(exs)))
exs = [ex for ex in exs if ex not in exs_20]
print("Remaining: ", str(len(exs)))
random.shuffle(exs)

fp = open("train_60.csv", "w")
for ex in exs:
    fp.write(ex + "\n")
fp.close()