[Solved] How can i read a csv based on data in other columns? [closed]
Using the built-in csv library to iterate over each row’s values will do the trick: import csv with open(‘data.csv’) as csvfile: csvin = csv.DictReader(csvfile) for row in csvin: if row[‘col2:’] == “true” and row[‘col3:’] == “false”: print(row[‘col1:’]) Output result: 1 0 solved How can i read a csv based on data in other columns? [closed]