[英]How to iterate through date header of excel sheet using pandas in python?
I have an excel sheet how can i iterate through the date as i want to iterate to each row. 我有一张Excel工作表,因为要迭代到每一行,我该如何迭代日期。 but there are two headers.
但是有两个标题。 i have attached a pic below.
我在下面附了一张图片。 one headers is of date.
一个标题是最新的。 and another header is some timing in , out time, total hours, etc. so each date has 7 columns.
另一个标题是进,出时间,总时数等时间,因此每个日期都有7列。 so there are 30 days.
所以有30天 i want to store the date some where in a variable as i can know which month is this.
我想将日期存储在变量中的某些位置,因为我可以知道这是哪个月。 and then i want to read the value in the header of each date.
然后我想读取每个日期的标题中的值。 and do some functionality.
并执行一些功能。 I am using python and panda library
我正在使用python和panda库
_____________|____________| 7/16/19 | 8/16/19 | 9/16/19 | 10/16/19 | 11/16/19 | ....
Employee Name|Employee ID |in-time|out-time|total-hours|status||in-time|out-time|total-hours|status||in-time|out-time|total-hours|status|in-time|out-time|total-hours|status||in-time|out-time|total-hours|status|
Shrey | SHAA | 5:00 | 13:00 |8 | WO | ..................................................................................
asd | dh | ...................................................................................
asf | ge | ....................................................................................
asdfd | ew | ...................................................................................
afdsfds | er | ......................................................................................```
Did you try to find on google how to do this? 您是否尝试在Google上找到如何执行此操作? You will find a lot of examples!
您会发现很多例子! Also you can look here: Python Loop through Excel sheets, place into one df
您也可以在这里查看: Python在Excel工作表中循环,放入一个df中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.