with open(filename) as f: rows = csv.reader(f) next(rows) return [ { 'name': row[0], 'shares': int(row[1]), 'price': float(row[2]), } for row in rows ]