How to read numbers in python from csv file?
Just cast as you append:
n.append(float(row[8]))
If there are empty strings catch those before appending.
try: n.append(float(row[8]))except ValueError: continue
Or you might want to try pandas, in particular pandas.read_csv:
import pandas as pddf = pd.read_csv("in.csv")print(df["col_name"].mean())