基于win10系统,python3.6
读取csv
使用csv函数包,安装
pip install csv
使用方法:
import csv
def fileload(filename = '待读取.csv'):
csvfile = open(filename, encoding = 'utf-8')
data = csv.reader(csvfile)
dataset = []
for line in data:
dataset.append(line)
csvfile.close()
return dataset
读取xlsx
使用xlrd函数包,安装:
pip install xlrd
使用方法: