csv中文读写

用pandas读取csv

竖着读

df = pd.read_csv(path, encoding=‘gbk’)
竖着读,'gbk’中文编码。'utf-8’英文
csv中文读写

横着读

total_line = len(open(find_anno_path, encoding='gbk').readlines())
line_list = [0, total_line]
df = pd.read_csv(find_anno_path, skiprows=line_list, encoding='gbk')

用csv读

上一篇:tomcate出现乱码,解决办法


下一篇:linux批量将文件编码由gbk转成utf8