openxlpy读写excel要比pandas快

这篇内容对比了openxlpy和pandas在读写Excel文件的速度,指出尽管openxlpy的代码可能更复杂,但在执行速度上比pandas略胜一筹。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

openxlpy读写excel要比pandas快一点的,尽管代码复杂些。

else:# 如果条码重复,添加记录并登记接收
    row = df.loc[df['Barcode'] == CODE] 
    if pd.isna(row['Receive'].values[0]) :  
       if is_on_UFH() == True : 
          current_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') 
          df.loc[df['Barcode'] == CODE,'Receive'] = computer_name  
          df.loc[df['Barcode'] == CODE, 'RecTime'] = current_time  时间
          df.to_excel(file_name, index=False)  # 将df保存到Excel文件中
          df.to_html(backup_htm)
          shutil.copyfile(file_name, backup_file_name)  # 备份xlsx文件

04139708607
Elapsed time: 0.04468226432800293 seconds

else:
   for row_index, row in enumerate(ws.iter_rows(values_only=True), start=1):
      if row[0] == CODE and row[3] is None:
         if 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值