MCPcopy Create free account
hub / github.com/Colin97/DeepMetaHandles / load_txt

Function load_txt

data_preprocessing/merge_data/merge_weight.py:8–18  ·  view source on GitHub ↗
(file_name)

Source from the content-addressed store, hash-verified

6root = '/YOUR/DATA/DIR'
7
8def load_txt(file_name):
9 with open(file_name) as f:
10 data = f.readlines()
11 n = int(data[0].split(" ")[0])
12 m = int(data[0].split(" ")[1])
13 weights = np.zeros((n, m))
14 for i in range(n):
15 w = data[i + 1].split(" ")
16 for j in range(m):
17 weights[i][j] = float(w[j])
18 return weights
19
20for cat in categories:
21 with open("all_%s.txt" % cat) as f:

Callers 1

merge_weight.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected