I am asking Python to print the minimum number from a column of CSV data, but the top row is the column number, and I don't want Python to take the top row into account. How can I make sure Python ignores the first line?
This is the code so far:
import csv
with open('all16.csv', 'rb') as inf:
incsv = csv.reader(inf)
column = 1
datatype = float
data = (datatype(column) for row in incsv)
least_value = min(data)
print least_value
Could you also explain what you are doing, not just give the code? I am very very new to Python and would like to make sure I understand everything.
1.0
for each line in your file and then taking the minimum, which is going to be1.0
? – Wooble1.0
. :) – Danicadatatype(row[column]
... is what I guess the OP is trying to achieve though – Jon Clements♦