Q:

Convert dataframe of one year into a dataframe with 365 columns (one by day)

I have a dataframe with time interval of 5 minutes. However all the interval are not present. Example:
Date                Value_1
...
2019-01-01 15:30:00 2.4866
2019-01-01 15:35:00 2.703
2019-01-01 15:40:00 0.0
2019-01-02 09:05:00 8.3087
2019-01-02 09:10:00 7.5134
2019-01-02 09:15:00 6.637
...

I would like to know if there is a simple way or a function (i did not find anything) to have a dataframe of 288 intervals based only by time
00:00:00
00:05:00
00:10:00
...
23:50:00
23:55:00

where each column is a day (365 for one year). Finally i would like populate this dataframe with the previous one. If no data is available, it could be a nan or 0.
Thank you.
Edit: change the inital dataframe to consider only one value by date

A:

you can do it with set_index with first level only the time from the column datetime and second level the date of the same column. Then unstack:
#sample dataframe
np.random.seed(1)
drange = pd.date_range('2019-01-01 09:30:00', freq='5T', periods=5)
df = pd.DataFrame({'datetime': drange.tolist() + (drange+pd.DateOffset(days=1)).tolist(),
                   'Value_1':np.random.randint(10, size=10),})
print (df)
             datetime  Value_1
0 2019-01-01 09:30:00        5
1 2019-01-01 09:35:00        8
2 2019-01-01 09:40:00        9
3 2019-01-01 09:45:00        5
4 2019-01-01 09:50:00        0
5 2019-01-02 09:30:00        0
6 2019-01-02 09:35:00        1
7 2019-01-02 09:40:00        7
8 2019-01-02 09:45:00        6
9 2019-01-02 09:50:00        9

# set_index and unstack
df_f = df.set_index([df['datetime'].dt.time, 
                     df['datetime'].dt.date])['Value_1']\
         .unstack()
print (df_f)
datetime  2019-01-01  2019-01-02
datetime                        
09:30:00           5           0
09:35:00           8           1
09:40:00           9           7
09:45:00           5           6
09:50:00           0           9

Then if you want to create all 5 minutes in index and each day in column, you can use reindex and ffill:
df_f = df_f.reindex(index=pd.date_range('2019-01-01 00:00:00', 
                                        freq='5T', periods=288).time, 
                    columns=pd.date_range('2019-01-01', 
                                          freq='D', periods=365).date)\
           .ffill()

