Advertisement

Python将多个工作表整合为一个工作表(避坑)

阅读量:

参考了这篇文章的相关内容,但在最终输出阶段代码出现了错误,具体解决办法可查阅[Python处理Excel遇到的“got invalid input value of type <class ‘xml.etree.ElementTree.Element‘>, exp”]( "Python处理Excel遇到的“got invalid input value of type <class ‘xml.etree.ElementTree.Element‘>, exp”")。

接下来直接附上本人最终调整完成的代码内容

复制代码
 import xlrd

    
 import pandas as pd
    
 from  pandas import DataFrame
    
 from openpyxl import load_workbook
    
 import os
    
 import inspect
    
  
    
 cur_dir = '\ '.join(os.path.abspath(inspect.getsourcefile(lambda:0)).split('\ ')[:-1]) # 获取当前绝对路径的上层目录 linux中应用'/'split和join
    
 excel_name = os.path.join(cu

全部评论 (0)

还没有任何评论哟~