1.利用csv库
import csv
csv_file_object = csv.reader(open('csv/train.csv', 'rb')) # Load in the csv file
header = csv_file_object.next() # Skip the fist line as it is a header
2.利用pandas
import pandas as pd
# For .read_csv, always use header=0 when you know row 0 is the header row
df = pd.read_csv('train.csv', header=0