#coding = gbk
import numpy as np
c,v,m=np.loadtxt('e:\000718.csv', delimiter=',', usecols=(3,6,13),unpack=True)
其中,csv文件中第二列有中文字符,不管我设定coding是utf-8还是gbk,均报错。删除第二列,程序可以运行。
我修改000718.csv为utf格式,或另存为utf的txt格式,程序依然出错;猜测还是编码的问题,该如何解决,请教各位大神?
第一次发帖,希望能得到大家的帮助,不胜感激~
报错信息:
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256)