大冶灵乡

 1 import pandas as pd
 2 from datetime import timedelta
 3 
 4 data1=pd.read_csv(r"C:\Users\HsqxtWwf\example\lx1.txt",header=0,sep="\s+")
 5 data2=pd.read_csv(r"C:\Users\HsqxtWwf\example\lx2.txt",header=0,sep="\s+")
 6 data=pd.concat([data1,data2])
 7 data["DateTime"]=data["Date"]+" "+data["Time"]
 8 
 9 data["DateTime"]=pd.to_datetime(data["DateTime"])
10 
11 data["DateTime_bj"] = data["DateTime"]+timedelta(hours=8)
12 
13 data.to_excel(r"C:\Users\HsqxtWwf\example\lx.xlsx")

 

posted @ 2022-04-20 20:11  EROEG  阅读(42)  评论(0编辑  收藏  举报