我尝试加载数据,但收到此错误消息:Unicode解码错误:'utf-8'编解码器无法解码位置341中的字节0xfe:无效起始字节有人知道我能做什么吗?numpy版本:'1.19.2'代码:
>>> raw_data_np = np.genfromtxt("loan-data.csv", delimiter = ';', skip_header = 1, autostrip = True) >>> raw_data_np
p8h8hvxi1#
这可能有点晚了,但试试这个:raw_data_np = np.genfromtxt(“loan-data.csv”,= ';',skip_header = 1,autostrip = True,encoding =“cp855”)或raw_data_np = np.genfromtxt(“loan-data.csv”,= ';',skip_header = 1,autostrip = True,encoding =“ANSI”)
1条答案
按热度按时间p8h8hvxi1#
这可能有点晚了,但试试这个:
raw_data_np = np.genfromtxt(“loan-data.csv”,= ';',skip_header = 1,autostrip = True,encoding =“cp855”)
或
raw_data_np = np.genfromtxt(“loan-data.csv”,= ';',skip_header = 1,autostrip = True,encoding =“ANSI”)