filePath = r"C:\Users\HP\Desktop\数据包"
nameList=os.listdir(filePath)
j=0
for i in nameList:
temp = pd.read_excel("C://Users//HP//Desktop//数据包//"+i, index_col=0)
# data = data.asfreq('D') #粒度
temp[temp == 0] = np.nan
temp.interpolate(inplace=True)
if j==0:
data=temp
j=1
else:
data = pd.concat([temp, data], axis=1)
data.dropna(axis=0, inplace=True)
data.to_excel(r"C:\Users\HP\Desktop\111.xlsx")
Python 读取一个文件夹下多个excel文件的数据
最新推荐文章于 2023-11-20 09:00:34 发布