Python pd.read\u excel数据删除错误
我正在尝试将数据从excel读取到pandas。我从api获取的文件未保存(对该文件的访问需要特殊权限,因此我不想保存)。当我试图从文件中读取excel时 我得到了错误 当我在文件中输入路径时,一切正常Python pd.read\u excel数据删除错误,python,pandas,file,Python,Pandas,File,我正在尝试将数据从excel读取到pandas。我从api获取的文件未保存(对该文件的访问需要特殊权限,因此我不想保存)。当我试图从文件中读取excel时 我得到了错误 当我在文件中输入路径时,一切正常 有没有一种方法可以通过pandas读取excel而不保存它并输入路径?缺少的部分是打开的'rb' with open('path_to_file', 'rb') as file: re = pd.read_excel(file) 将文件视为二进制文件。想法取自尝试以字节形式读取文件:以
有没有一种方法可以通过pandas读取excel而不保存它并输入路径?缺少的部分是打开的
'rb'
with open('path_to_file', 'rb') as file:
re = pd.read_excel(file)
将文件视为二进制文件。想法取自尝试以字节形式读取文件:
以open('path_to_file','rb')形式读取文件
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position
10: invalid start byte
re = pd.read_excel('path-to-exactly-the-same-file')
with open('path_to_file', 'rb') as file:
re = pd.read_excel(file)