I have a dataframe with data for each hourly period for a year, and I would like to create a new row with a zero in all the rows that are between 9:00 and 17:00 and in that same row add the data from another row if it is not in this time range
I believe that I want something like;
if '9.00' >= final_df.index <= '17.00':
do some action
else
do another action
This is not yet working, the first reason is that at the moment it is missing the full date. Is there some way I can get around that? The first line sort of works if I use;
if '2017-10-16 9.00' >= final_df.index <= '2017-10-16 17.00':
Is there a way I can get around this.
For reference the first 5 data points are;
A B C D E
Timestamp
2017-10-15 13:30:00 59.9 17.14 0 1 0
2017-10-15 14:30:00 64.3 17.22 0 1 0
2017-10-15 15:30:00 68.6 17.18 0 1 0
2017-10-15 16:30:00 77.6 17.08 0 1 0
2017-10-15 17:30:00 74.5 16.93 0 1 0