解决一些 高效办公问题的话,我们可能会使用到GPT
问题:
报错部分提示:in import_optional_dependency raise ImportError(msg) ImportError: Missing optional dependency 'o
解决: 未安装 openpyxl
df = pd.read_excel(sorce_file, engine=‘openpyxl’, sheet_name=‘Sheet1’, index_col=0)
没有read——excel ()
的依赖
使用pippip install openpyxl
进行安装
pip install openpyxl
Collecting openpyxl
Downloading openpyxl-3.1.2-py2.py3-none-any.whl (249 kB)
---------------------------------------- 250.0/250.0 kB 1.2 MB/s eta 0:00:00
Collecting et-xmlfile (from openpyxl)
Downloading et_xmlfile-1.1.0-py3-none-any.whl (4.7 kB)
Installing collected packages: et-xmlfile, openpyxl
Successfully installed et-xmlfile-1.1.0 openpyxl-3.1.2
[notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
成功
小细节:
根据不同的收集人数,请注意·
数组越界
的问题,excel 中数组仅有 36人,请记得在代码中修改。(具体问题具体分析~)