import pandas
name = 'filename.xlsx'
data = pandas.read_excel(name)
print(data)
我試圖使用 Pandas 打開一個 excel 檔案,但出現錯誤:
AttributeError: partially initialized module 'pandas' has no attribute 'read_excel' (most likely due to a circular import)
可能是什么問題,因為它不是代碼,因為它在不同的計算機上作業。
uj5u.com熱心網友回復:
那可能是因為您正在處理另一個目錄。嘗試將檔案路徑添加到檔案名中:
name = your_file_path 'filename.xlsx'
data = pandas.read_excel(name)
uj5u.com熱心網友回復:
發現問題。我只是忘了 pip install openpyxl
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/349801.html
