博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
遍历文件夹下的csv,把数据读进一张表
阅读量:4665 次
发布时间:2019-06-09

本文共 383 字,大约阅读时间需要 1 分钟。

import pandas as pdimport osif __name__ == '__main__':    Path = 'c:\checklog'    dfs = []    for dir_path, dir_names, file_names in os.walk(Path):        for f in file_names:            dfs.append(pd.read_csv(os.path.join(dir_path, f), header=None))    df = pd.concat(dfs, sort=False)    df.to_excel('c:\checklog\out.xlsx')

转载于:https://www.cnblogs.com/donggongdechen/p/11324047.html

你可能感兴趣的文章
WebClient 调用api
查看>>
《Spring实战》-2
查看>>
php中静态方法的使用
查看>>
转:影响数据检索效率的几个因素
查看>>
Xamarin.Android 的照相機使用
查看>>
全文检索-Elasticsearch (三) DSL
查看>>
MySQL 查询缓存
查看>>
文档对象模型(DOM)系列一:DOM基础
查看>>
js代码收集(1)
查看>>
二:输入10个整数,将它们从大到小排序后输出。
查看>>
mongodb删除重复数据
查看>>
项目中遇到的问题:前台 disabled 与 后台disabled
查看>>
BZOJ1801:[Ahoi2009]chess 中国象棋
查看>>
多态(3)面向对象的三大特征之三
查看>>
简单高效的代码部署方法
查看>>
[Spring框架]Spring JDBCTmplate基础入门总结.
查看>>
ecshop修改产品详情 折扣倒计时时间
查看>>
Core Java Volume I — 4.10. Class Design Hints
查看>>
hdu 1785 You Are All Excellent
查看>>
IE中,多次弹出Pop页面,光标无法落入Pop页面中的Input,导致无法输入
查看>>