def extractRows(fileName):
fileName = 'results/cvpr_db_results/'+fileName+'.csv'
with open(fileName, 'r') as csvfile:
lines = csv.reader(csvfile)
for row in lines:
if row[0] != "name":
retval = [int(x) if x != "" else -100 for x in row[1:-2] ]
else:
nameRow = row[1:-2]
if row[0] == "causalgrammar":
causalRow = retval
elif row[0] == "origdata":
origRow = retval
elif row[0] == "random":
randomRow = retval
return {"nameRow": nameRow, "causalRow": causalRow, "origRow": origRow, "randomRow": randomRow}
评论列表
文章目录