我尝试了以下内容 这里target_conditions是要与PLM中的列进行比较的列表
csv file
with open('PLM.csv', 'rt') as f:
reader = csv.reader(f, delimiter=',')
for row in reader:
for str in target_conditions:
str=str.split(',')
if str in row[3]:
print ("is in file") #but i need the patient name to be displayed
答案 0 :(得分:0)
我修改了代码,以便从PLM.csv文件中的列中找到target_conditions列表的值。
with open('PLM.csv', 'rt') as csvfile:
reader = csv.reader(csvfile, delimiter=',')
for row in reader:
for str in target_conditions:
if str in row:
print(row[row.index(str)])
我希望这会对你有所帮助。