everyone! I use python3(pycharm),and my codes are like these:
# -*- coding: utf-8 -*-
import numpy
c=numpy.loadtxt('test.csv',dtype="str_",delimiter=',',usecols=(6,),unpack=True)
when I have some Chinese words in test.csv,I got a error like this:
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-5: ordinal not in range(256)
I have tried to encode the file,like this:
c=numpy.loadtxt('test.csv'.encode('utf-8'),dtype="str_",skiprows=0,delimiter=',',usecols=(6,),unpack=True)
And then,I got another error:
IndexError: list index out of range
Besides,the Chinese words in the file are longer than 64.
I have waste a lot of time on this,Please give me a hand!