I have a datetime array which has hour, minute and second information. I want to remove the minute and second infromation from it and change the hour to the next hour.
i.e. peak_interval
array([datetime.datetime(2010, 12, 13, 6, 0),
datetime.datetime(2011, 1, 12, 7, 0),
datetime.datetime(2011, 3, 23, 16, 45),
datetime.datetime(2011, 4, 19, 17, 15)], dtype=object)
I want to obtain the following:
peak_interval
array([datetime.datetime(2010, 12, 13, 7, 0),
datetime.datetime(2011, 1, 12, 8, 0),
datetime.datetime(2011, 3, 23, 17, 0),
datetime.datetime(2011, 4, 19, 18, 0)], dtype=object)
I can write some kind of for loop but I am trying to use some smart method if possible.