2023-04-12-- 读文件遇到的UnicodeDecodeError: ‘utf-8‘ codec can‘t decode bytes in position 1022-1023: un...
withtf.io.gfile.GFile(filepath,mode='r')asf:df=pd.read_csv(f,dtype={''xxxx":'str',})上述代码报UnicodeDecodeError:'utf-8'codeccan'tdecodebytesinposition262142-262143:unexpectedendofdata解决方案为将mode='r'改为mode=