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

建设网站企业网上银行登录官方做羞羞事视频网站

建设网站企业网上银行登录官方,做羞羞事视频网站,网站建设要求 优帮云,wordpress标签作用批量新增excel文件 import osimport xlwings as xwapp xw.App(visibleTrue,add_bookFalse)#visible设置为ture的时候会自动打开创建的excel文件,设为为false的时候不会看到excel文件打开了,实际进程占用了....dept_list [人事部,财务部,研发部,行政部…
  1. 批量新增excel文件

    	import osimport xlwings  as xwapp = xw.App(visible=True,add_book=False)#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')
    
  2. 批量打开excel文件

    import os
    import xlwings  as xw
    app = xw.App(visible=True,add_book=False)
    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)
    
  3. 批量修改excel文件工作表名

     import osimport xlwings  as xwapp = xw.App(visible=False,add_book=False)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')
  1. 合并一个excel文件多个sheet页内容到第一个sheet页中

    
    import pandas as pd
    import xlwings as xw
    file = f'{dept_path}\部门业绩-行政部.xlsx'
    df_list = pd.read_excel(file,sheet_name=None)
    df_all = pd.concat(df_list.values())
    app=xw.App(visible=False,add_book=False)
    workbook = app.books.open(file)
    workbook.sheets.add('汇总表',before=workbook.sheets[0])
    workbook.sheets['汇总表'].range('A1').options(index=False).value=df_all
    workbook.save()
    workbook.close()
    app.quit()
    
  2. 拆分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')
    
  3. 拆分excel表(按照某个分类拆分成不同的sheet页)

    import pandas as pd
    file = f'{dept_path}\采购表.xlsx'
    #读取所有sheet页
    df_list= pd.read_excel(file,sheet_name=None,parse_dates=False)
    #合并成一个大数据表
    df_all = pd.concat(df_list.values())file2 = f'{dept_path}\采购表-按产品类分.xlsx'
    excel_writer = pd.ExcelWriter(file2,date_format='YYYY-MM-DD')
    for product,df in df_all.groupby('产品类型'):df.to_excel(excel_writer,product,index=False)
    excel_writer.save()
  4. 比较2个excel文件内容

    import os
    import xlwings  as xwapp = xw.App(visible=False,add_book=False)
    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.yayakq.cn/news/45241/

相关文章:

  • 金沙洲网站建设工作室wordpress sql 查询
  • 网站建设的业务规划工信部个人网站备案
  • 哪里有网站制作价格关键词排名优化公司
  • 企业站模板明细做用户运营应该关注哪些网站
  • 花都网站设计wordpress百家号模版
  • 网站建设大概需要多少钱全国十大网站设计工作室
  • 广州网站建设 .超凡科技中国海峡建设公司官网
  • 两江新区建设管理局网站酷虎云建站
  • 网站开发规划方案杭州软装设计公司哪家好
  • 怎么创建微信公众号平台苏州网站优化公司
  • 移商网站建设wordpress wpml
  • 专门做艺术字的网站老备案域名购买
  • 苏州网站备案查询网站建设 中企动力泉州
  • 手机wap网站程序神箭手 wordpress
  • 建设银行信用卡在网站激活后如何设置密码网站建设创业基础ppt模板
  • 凡科可以做游戏网站吗wordpress文档编辑
  • win7电脑做网站主机百度搜索历史记录
  • 北京网站优化软件天津科技公司网站
  • 网站建设年份查询网络营销案例分析和启示
  • 网站制作公司咨询网站为什么做静态
  • 做粤菜的视频网站红杉网站建设
  • 长治网站公司wordpress 安全吗
  • 网站推广文章域名对网站有什么影响吗
  • 写一个有图片的网页汕头seo优化
  • 十堰响应式网站seo实战优化
  • 企业手机网站建设机构做seo网页价格
  • 怎么做网站赚大钱wdcp创建网站
  • 网站默认图片素材菜鸟html教程
  • 公交车网站怎么做留言板深圳有做网站最近价格?
  • 建设网站需要懂什么意思wordpress 迁移 群晖