我尝试了以下这里的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
我已经修改了代码,以从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)])
我希望这对您有帮助。