scv文件单元格内存在换行符
错误代码:
for i in range(4):
path = "E:\\hanjia\\shiyansuodeshuju\\1\\data" + str(i+1) + ".csv"
# 分时间段计算载客数量
for line in open(path):
导致读取数据出现异常,一行数据读取成了三行
正确代码
with open (path,'rt') as csvfile:
reader=csv.reader(csvfile,delimiter=',',quotechar='"',doublequote=False)
for row in reader: