from ast import literal_eval
literal_eval函数
pandas.read_csv(filename, sep=’\t’)
官方网址:http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html
此处用到的参数解释:
此函数的作用-Read CSV (comma-separated) file into DataFrame
filename:读取到csv文件的路径。
sep:指定分隔符,默认为逗号。注意还有一参数为delimiter,同sep,当此参数指定,sep无效。
好吧,还想多写一点:其中还有一参数为header,用来指定csv文件中被用作列名的行数,默认为0,如果csv文件中没有列名,header=none,想要指定列名可以用name这一参数。
dataframe.head(n=5)
官方文档
比较简单,直接copy官方的参数解释:This function returns the first n rows for the object based on position. It is useful for quickly testing if your object
has the right type of data in it.