File size: 570 Bytes
dcacefd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import numpy as np
import os
import pickle
if os.path.exists('pocket_score.pkl'):
    with open('pocket_score.pkl', 'rb') as f:
        pocket_score = pickle.load(f)
else:
    pocket_score={}

with open('PocketMatch_score.txt', 'r') as f:
    for line in f.read().splitlines():
        pocket = line[:32].strip()
        score = float(line[75:75+8])
        if pocket in pocket_score:
            pocket_score[pocket].append(score)
        else:
            pocket_score[pocket]=[score]

file = open('pocket_score.pkl', 'wb')
pickle.dump(pocket_score, file)
file.close()