I asked this question and I got an answer which works for a general case with sequential and non missing data but not for my case specifically. I have a DF that looks as follows.
eventTime MeteredEnergy Demand RunningHoursLamps
6/7/2018 0:00 67.728 64 1037.82
6/7/2018 1:00 67.793 64 1038.82
6/7/2018 2:00 67.857 64 1039.82
6/7/2018 3:00 67.922 64 1040.82
6/7/2018 4:00 67.987 64 1041.82
6/7/2018 5:00 64 1042.82
6/7/2018 6:00 1043.43
6/7/2018 23:00 68.288
6/8/2018 0:00 67.728 64 1037.82
6/8/2018 23:00 67.793 64 1097.82
I need a DF that finds the difference between RunningHoursLamps values at hour 0 and hour 23 for each unique date in "eventTime" If data is missing for hour 0 or hour 23, the resultant DF can have NaN
Expected output
Date 00:00 23:00 Difference
6/7/2018 1037.82 NaN NaN
6/8/2018 1037.82 1097.82 60