[英]Unable to read .xpt file from s3 raw bucket using pandas.read_sas
我正在尝试使用 pandas.read_sas 方法读取 S3 原始存储桶中存在的 SAS 传输文件(.xpt),但出现错误
AttributeError: 'bytes' object has no attribute 'encode'
这是代码片段:
from boto.s3.connection import S3Connection
import boto3
import pandas as pd
import xport
"""after setting the S3 bucket details-this is how I am trying to read xpt"""
dr1=pd.read_sas("s3://" + mybucket_name + "/test.xpt", format="xport")
这是我收到错误"AttributeError: 'bytes' object has no attribute 'encode'"
将 pandas 版本降级到 0.23.4 后,我获得了成功。 似乎 pandas 版本 0.25.x 在从 S3 存储桶读取.xpt 文件时存在一些问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.