I have the following type of date in my data:
21.02.2015 08:00 - 21.02.2015 14:59 (CET) content1 content2
I now want to split the time into hourly time rows which contain the same contents as the row above (above I want it to be splitted until 14:00). How could I do this for the whole dataframe?
I would have started with converting like this:
def split_timerange(date1, date2):
start= datetime.datetime.strptime(date1,'%Y.%m.%d %H:%M:S')
end = datetime.datetime.strptime(date1, '%Y.%m.%d %H:%M:S')
timerangehourly = pd.date_range(start,end,freq='H')
I do not know how to create for each element of the dataframe 'timerangehourly' a seperate column with the contents of the range. Any ideas? Thanks!
Additional info how the data looks like:
21.02.2015 08:00 - 21.02.2015 14:59 (CET) Cancelled outage Planned
outage Generation Unit CTA|DE(50Hertz) PSW Markersbach PSS B 174 0
These are all the columns I have. What whould be perfect would be a transformation that in the first columns there is the time and it says which power station (e.g.'PSW Markersbach') has an outage. Is this somehow possible?