Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Advertisement
Add Comment
Please, Sign In to add comment