当我尝试读取csv文件时遇到问题:
# Load satisfaction table
client = boto3.client('s3') #low-level functional API
resource = boto3.resource('s3') #high-level object-oriented API
my_bucket = resource.Bucket('bucket1') #subsitute this for your s3 bucket name.
obj = client.get_object(Bucket='bucket1', Key='file.csv')
data = pd.read_csv(io.BytesIO(obj['Body'].read()), delimiter=',',engine='python', encoding='utf-8')
我收到此错误:
UnicodeDecodeError: 'utf8' codec can't decode byte 0x96 in position 76: invalid start byte
请问好吗?
谢谢
答案 0 :(得分:0)
遇到问题:
在OSx上,通过删除
解决.aws
用户资料下的文件夹。 好像boto3调用.aws文件夹的内容。