我应该如何将日期格式从01/13更改为1/13,两者在python中都应该是日期格式? 我的数据框如下所示:
而我的代码的预期部分如下所示,我希望通过行索引和列索引查找特定单元格,其中我得到了行索引部分,但列索引没有出现,并显示此错误:
formated_day=(date.today() - timedelta(i)).strftime("%m/%d")
row_number=dataframe_wsheet.loc[dataframe_wsheet[""]==name].index.values
print(row_number)
[5]
dataframe_wsheet.loc[:,formated_day]
它显示了这个错误:
KeyError: 'the label [01/13] is not in the [columns]'
目前没有回答
相关问题 更多 >
编程相关推荐