我剛剛下載了Python3.5,並且一直試圖做幾個小時的簡單任務(打開一個Excel文件並從文件中刪除前三行和各列),但沒有成功。基本的ExcelFile讀取不工作
我試圖打開文件時發生了最新的問題。
這是唯一的代碼:
import pandas as pd
df = pd.ExcelFile("January2016.xlsx")
我收到以下錯誤無論怎樣讀選項我與熊貓使用。
Traceback (most recent call last):
File "C:\Python35\lib\site-packages\IPython\core\interactiveshell.py", line 2847, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-25-503f922e97e7>", line 1, in <module>
df = pd.ExcelFile("January2016.xlsx")
File "C:\Python35\lib\site-packages\pandas\io\excel.py", line 257, in __init__
self.book = xlrd.open_workbook(io)
File "C:\Python35\lib\site-packages\xlrd\__init__.py", line 422, in open_workbook
ragged_rows=ragged_rows,
File "C:\Python35\lib\site-packages\xlrd\xlsx.py", line 833, in open_workbook_2007_xml
x12sheet.process_stream(zflo, heading)
File "C:\Python35\lib\site-packages\xlrd\xlsx.py", line 548, in own_process_stream
self_do_row(elem)
File "C:\Python35\lib\site-packages\xlrd\xlsx.py", line 745, in do_row
value = error_code_from_text[tvalue]
KeyError: None
請幫忙!
你試過'pd.read_excel(「January2016.xlsx」)'嗎? –
@coldspeed'pd.read_excel(「January2016.xlsx」)'返回與上面相同的錯誤。 –