data=[]
label=[]
with open('data/body.txt') as f2:
for line in f2:
lines=line.strip().split(' ')
data.append([float(tk) for tk in lines[:-1]]) #float(tk) for tk in 循环遍历将数据班委float
#data.append( lines[:-1])
label.append(lines[-1])
print(lines)
print(data)
print(label)
循环遍历将数据变为float
最新推荐文章于 2022-03-08 21:01:44 发布