本文共 1403 字,大约阅读时间需要 4 分钟。
#-*-coding:utf-8-*-importpandasaspdcatering_sale='E:\BaiduYunDownload\Python_info\chapter3\demo\data\catering_sale.csv'data=pd.read_excel(catering_sale,index_col=u'日期')...
# -*- coding: utf-8 -*-
import pandas as pd
catering_sale = 'E:\BaiduYunDownload\Python_info\chapter3\demo\data\catering_sale.csv'
data = pd.read_excel(catering_sale,index_col = u'日期')
data.describe()
出错的结果
Traceback (most recent call last):
File "E:\Code\PythonCode\test.py", line 4, in
data = pd.read_excel(catering_sale,index_col = u'镞ユ湡')
File "D:\mytools\python\lib\site-packages\pandas\io\excel.py", line 191, in read_excel
io = ExcelFile(io, engine=engine)
File "D:\mytools\python\lib\site-packages\pandas\io\excel.py", line 249, in __init__
self.book = xlrd.open_workbook(io)
File "D:\mytools\python\lib\site-packages\xlrd\__init__.py", line 441, in open_workbook
ragged_rows=ragged_rows,
File "D:\mytools\python\lib\site-packages\xlrd\book.py", line 91, in open_workbook_xls
biff_version = bk.getbof(XL_WORKBOOK_GLOBALS)
File "D:\mytools\python\lib\site-packages\xlrd\book.py", line 1230, in getbof
bof_error('Expected BOF record; found %r' % self.mem[savpos:savpos+8])
File "D:\mytools\python\lib\site-packages\xlrd\book.py", line 1224, in bof_error
raise XLRDError('Unsupported format, or corrupt file: ' + msg)
XLRDError: Unsupported format, or corrupt file: Expected BOF record; found '\xc8\xd5\xc6\xda,\xcf\xfa\xc1
展开
转载地址:http://sytnx.baihongyu.com/