I have a year-long data set with dates and temperatures that's sample every 15min with occasional gaps in the data in Python. I've saved the dates and temperatures into a dataframe in pandas:
2015-08-21 09:35:47 27.928
2015-08-21 09:55:47 28.839
2015-08-21 10:15:47 28.495
...
2016-08-10 05:39:24 11.246
2016-08-10 05:59:24 11.912
2016-08-10 06:19:24 13.066
I would like to resample the data into every hour and tried with this line:
newDat=data.resample(rule='H')
I also tried using the first and last 'how' but still didn't get what I was looking for. My results looked like:
2015-08-21 09:00:00 28.383500
2015-08-21 10:00:00 27.959667
2015-08-21 11:00:00 29.513333
...
2016-08-10 06:00:00 14.235667
2016-08-10 07:00:00 20.867333
2016-08-10 08:00:00 26.725000
I don't want the actual temperature or time values changed. I would like the command to grab the first times within every hour of the day so I get something like:
2015-08-21 09:15:47 27.925
2015-08-21 10:15:47 28.495
2015-08-21 11:15:47 27.596
...
2016-08-10 07:19:24 16.944
2016-08-10 08:19:24 27.149
2016-08-10 09:19:24 28.152