Open
Description
Dear,
I run the function on my computer. But the final file including training and test both contains only one record and the rest of the record in the file is the same as the first one.
def get_data(file_loc):
f = open(file_loc, 'r')
data = []
for line in f:
new_arr = []
arr = line.split(' #')[0].split()
score = arr[0]
q_id = arr[1].split(':')[1]
new_arr.append(int(score))
new_arr.append(int(q_id))
arr = arr[2:]
for el in arr:
new_arr.append(float(el.split(':')[1]))
data.append(new_arr)
f.close()
return np.array(data)
Metadata
Metadata
Assignees
Labels
No labels