python pandas 讀取excel
import numpy as npimport pandas as pddata_csv = pd.read_table('c:\\2.csv',sep=',')print("data_csv:")print(data_csv)
傳統讀取csv檔案方法
import csvcsvFile = open("c:\\1.csv","r")reader = csv.reader(csvFile) # 返回的是迭代型別data = []for item in reader: print(item) data.append(item)print(data,"3")print(data[0],"2") print(data[0][0],"1")csvFile.close()