with tf.io.gfile.GFile(filepath, mode='r') as f:
df = pd.read_csv(f, dtype={
''xxxx": 'str',
})
上述代码报
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 262142-262143: unexpected end of data
解决方案为将mode='r' 改为 mode='rb'
with tf.io.gfile.GFile(filepath, mode='rb') as f:
df = pd.read_csv(f, dtype={
''xxxx": 'str',
})