- How to open a CSV,read a particular header of column and get the highest value
- import csv
- col_name = "name"
- with open("file.csv", "rb") as f:
- reader = csv.reader(f)
- col_index = next(reader).index(col_name)
- highest = max(rec[col_index] for rec in reader)