遍历dataframe
2024-09-05 16:05:39
import pandas as pd
import os if __name__ == '__main__':
Folder_Path = 'c:\checklog' os.chdir(Folder_Path)
file_list = os.listdir() writer = pd.ExcelWriter('c:\shuju\out.xlsx')
list = [] for item in file_list:
file_path = os.path.join(Folder_Path, item)
df = pd.read_excel(file_path, sheet_name=0) for index, row in df.iterrows():
if isinstance(row['核查说明'], str):
list.append(row) df2 = pd.DataFrame(list)
df2.to_excel(writer, sheet_name='sheet1')
writer.save()
最新文章
- cxf WebService设置wsdl中soapAction的值
- IOSGCD
- HDU 2717 Catch That Cow(BFS)
- [原]项目进阶 之 集群环境搭建(二)MySQL集群
- php拦截器(魔术方法)
- Xcode如何简单安装Alcatraz
- PhpStorm 10.0注册
- 【原】eclipse创建maven工程时,如何修改默认JDK版本?
- Go语言--数组、切片、
- 2.9 while循环
- laravle框架报错Malformed UTF-8 characters, possibly incorrectly encoded
- angular如何引入公共JS
- js中创建对象
- 了解AOP
- Maven项目中添加JDBC驱动
- 将AJAX Post的Data转为对应的Class
- Cassandra概念学习系列之Cassandra是什么?
- HDU 3262/POJ 3829 Seat taking up is tough(模拟+搜索)(2009 Asia Ningbo Regional)
- mysql库操作
- post get 方法
热门文章
- codefroces Round #201.B--Fixed Points
- C++入门经典-例6.13-指针与二维数组
- C++入门经典-例2.4-使用scanf格式输入函数得到用户输入的数据
- Scala学习(二)——高级特性
- 有关C#写一个WindowsService的两篇文章
- leetcode 128最长连续序列
- 从txt导入数据到mysql
- JAVA初级面试题,附个人理解答案
- python中_new_()与_init_()的区别
- IP冲突如何把冲突的IP挤下去