标签:
python本身方法:
f=open("xx.csv","r") b=f.read() rows=b.split(‘\n‘) full_data = [] for row in rows: cols_in_a_row=row.split(‘,‘) full_data.append(cols_in_a_row)
NumPy方法:
import numpy # Note that we don‘t need to use the open function to open it -- numpy will take care of that. # numpy.ndarray nfl = numpy.genfromtxt("nfl.csv", delimiter=",",dtype="U75", skip_header=1)
Pandas方法:
import pandas # DATAFRAME housing_2013 = pandas.read_csv("Hud_2013.csv")
标签:
原文地址:http://www.cnblogs.com/arsh/p/5115503.html