当前位置: 首页 > news >正文

雄安网站开发公司森网站建设

雄安网站开发公司,森网站建设,建设工程规划许可证公示网站,网站常见错误批量新增excel文件 import osimport xlwings as xwapp xw.App(visibleTrue,add_bookFalse)#visible设置为ture的时候会自动打开创建的excel文件#xff0c;设为为false的时候不会看到excel文件打开了#xff0c;实际进程占用了....dept_list [人事部,财务部,研发部,行政部… 批量新增excel文件 import osimport xlwings as xwapp xw.App(visibleTrue,add_bookFalse)#visible设置为ture的时候会自动打开创建的excel文件设为为false的时候不会看到excel文件打开了实际进程占用了....dept_list [人事部,财务部,研发部,行政部]path os.path.abspath(os.path.abspath(os.path.dirname(__file__)))dept_path os.path.join(path,excel文件)for dept in dept_list:workbook app.books.add()workbook.save(f{dept_path}/部门业绩-{dept}.xlsx)批量打开excel文件 import os import xlwings as xw app xw.App(visibleTrue,add_bookFalse) for dir,curdir,files in os.walk(dept_path):if files:for file in files:file_path os.path.join(dir,file)if file.endswith(.xlsx):app.books.open(file_path)批量修改excel文件工作表名 import osimport xlwings as xwapp xw.App(visibleFalse,add_bookFalse)path os.path.abspath(os.path.abspath(os.path.dirname(__file__)))dept_path os.path.join(path,excel文件)#批量修改 【部门业绩-行政部.xlsx 】 这个文件的工作表名workbook app.books.open(f{dept_path}\部门业绩-行政部.xlsx)for sheet in workbook.sheets:sheet.name sheet.name.replace(Sheet,部门)workbook.save()app.quit()4.合并相似excel文件内容到一个excel只会合并每个excel第一个sheet页的内容 import pandas as pddata_list []for dir,curdir,files in os.walk(dept_path):if files:for file in files:file_path os.path.join(dir,file)if file.endswith(.xlsx) and file.startswith(部门业绩-):data_list.append(pd.read_excel(file_path))data_all pd.concat(data_list)data_all.to_excel(部门业绩.xlsx)合并一个excel文件多个sheet页内容到第一个sheet页中 import pandas as pd import xlwings as xw file f{dept_path}\部门业绩-行政部.xlsx df_list pd.read_excel(file,sheet_nameNone) df_all pd.concat(df_list.values()) appxw.App(visibleFalse,add_bookFalse) workbook app.books.open(file) workbook.sheets.add(汇总表,beforeworkbook.sheets[0]) workbook.sheets[汇总表].range(A1).options(indexFalse).valuedf_all workbook.save() workbook.close() app.quit()拆分excel表按照某个分类拆分成不同的excel表 import pandas as pd file f{dept_path}\产品表.xlsx df pd.read_excel(file) products df[产品类型].unique() #去重获取产品类型这一列所有产品for product in products:df_product df[df[产品类型]product]df_product.to_excel(f{dept_path}\产品表-{product}.xlsx)拆分excel表按照某个分类拆分成不同的sheet页 import pandas as pd file f{dept_path}\采购表.xlsx #读取所有sheet页 df_list pd.read_excel(file,sheet_nameNone,parse_datesFalse) #合并成一个大数据表 df_all pd.concat(df_list.values())file2 f{dept_path}\采购表-按产品类分.xlsx excel_writer pd.ExcelWriter(file2,date_formatYYYY-MM-DD) for product,df in df_all.groupby(产品类型):df.to_excel(excel_writer,product,indexFalse) excel_writer.save() 比较2个excel文件内容 import os import xlwings as xwapp xw.App(visibleFalse,add_bookFalse) file f{dept_path}\产品表.xlsx file_back f{dept_path}\产品表-备份.xlsx book app.books.open(file) book_backup app.books.open(file_back)for row in book.sheets[0].range(A1).expand():for cell in row:backup_cell book_backup.sheets[0].range(cell.address)if cell.value ! backup_cell.value:cell.color backup_cell.color (255,0,0) book.save() book.close() book_backup.save() book_backup.close() app.quit()
http://www.tj-hxxt.cn/news/230937.html

相关文章:

  • 做网站都要会些什么郑州网站建设选微锐
  • 淘宝联盟登记新网站深圳公司注册地址可以是住宅吗
  • 安徽网站搭建北京网站建设小鱼在线
  • 大学生网站开发接单全球最大的网站建设外包网
  • 手工艺品外贸公司网站建设方案北京建设工程联合验收网站
  • 怎样做易支付网站太原网站建设制作
  • 徐东做网站凡客官网首页
  • 电白网站开发公司企业官网招聘信息
  • 深圳企业网站公司网站备案号密码找回
  • 营销型手机网站小程序商城哪家好些
  • 站长工具端口网站优化大赛
  • 易语言编程可以做网站么网站你懂我意思正能量免费下载
  • 网站安全狗 拦截301php网站开发都需要什么软件
  • 专业提供网站建设服务包括哪些网上怎么推广公司产品
  • 邯山区建设局网站合肥网站建设开发
  • 湖北省随州市建设厅网站公司的官方网站的作用
  • 德成建设集团有限公司网站孝感市网站建设公司
  • 北京网站建设推广服微信网站程序
  • 国内红酒网站建设长春网络公司营销模式
  • 南京建网站公司wordpress 公司内网
  • 新余网站建设找谁做自己在线制作logo免费广告招牌
  • 外贸邮箱用哪个比较好外链seo推广
  • 无锡自适应网站开发电子商务的就业方向
  • 网站建设实验步骤上海建筑设计院
  • wordpress网站加密wordpress 编辑 所见即所得插件
  • 做投票链接网站西安企业网站怎么建立
  • 百度云服务器挂网站北京网站设计公司有哪些
  • 新的网络推广方式147seo工具
  • 个人网站更换域名代做网站关键词
  • wordpress 影视主题WordPress优化速度插件