摘要: import globimport osimport pandas as pdread_path = 'D:/Data' # 要读取的文件夹的地址read_excel = glob.glob(os.path.join(read_path,'*.xlsx')) # 读取文件夹中所有后缀为xlsx的文件 阅读全文
posted @ 2019-12-20 15:21 张知行 阅读(3947) 评论(0) 推荐(0) 编辑
摘要: 因为数据不方便展示,直接上代码。 将字符串转为datetime64[ns]格式: pd.to_datetime('2019-12-20') or pd.to_datetime('20191220') 以上两种方式都可以转为日期格式 还可以直接将一列直接转为日期格式,如下:(字符串格式必须和以上两种相 阅读全文
posted @ 2019-12-20 15:00 张知行 阅读(5667) 评论(0) 推荐(0) 编辑
摘要: 1 import pandas as pd 2 df = pd.DataFrame([['12345',1], 3 ['23456',2], 4 ['34567',3], 5 ['45678',4], 6 ['56789',5], 7 ['67890',6]],columns=['str','num 阅读全文
posted @ 2019-12-20 14:43 张知行 阅读(29711) 评论(0) 推荐(0) 编辑