我有一个Excel工作簿,我已经加载并将所有工作表放在一起,现在我想添加一个列,其中我有每个原始工作表的名称,我不知道在我将所有内容放在一起之前是否必须这样做,如果我可以这样做,我正在使用熊猫。这是到目前为止我的代码,我希望工作表名称或编号在“周”列中
xlsx= pd.ExcelFile('archivo.xlsx')
hojas=[]
for hojaslibro in xlsx.sheet_names:
hojas.append(xlsx.parse(hojaslibro))
estado=pd.concat(hojas,ignore_index=True)
estado['Week']=0
这应该起作用:
相关问题 更多 >
编程相关推荐