How do I fill the Date column so that when it detects a date it adds that date to the below rows, until it sees a new date starts adding that date?
Reproducible example:
Input:
Date Headline
0 Mar-20-21 04:03AM Apple CEO Cook, executives on tentative list o...
1 03:43AM Apple CEO Cook, execs on tentative list of wit...
2 Mar-19-21 10:19PM Dow Jones Futures: Why This Market Rally Is So...
3 06:13PM Zuckerberg: Apples Privacy Move Could Spur Mor...
4 05:45PM Apple (AAPL) Dips More Than Broader Markets: W...
5 04:17PM Facebook Stock Jumps As Zuckerberg Changes Tun...
6 04:03PM Best Dow Jones Stocks To Buy And Watch In Marc...
7 01:02PM The Nasdaq's on the Rise Friday, and These 2 S...
Desired Output:
Date Headline
0 Mar-20-21 04:03AM Apple CEO Cook, executives on tentative list o...
1 Mar-20-21 03:43AM Apple CEO Cook, execs on tentative list of wit...
2 Mar-19-21 10:19PM Dow Jones Futures: Why This Market Rally Is So...
3 Mar-19-21 06:13PM Zuckerberg: Apples Privacy Move Could Spur Mor...
4 Mar-19-21 05:45PM Apple (AAPL) Dips More Than Broader Markets: W...
5 Mar-19-21 04:17PM Facebook Stock Jumps As Zuckerberg Changes Tun...
6 Mar-19-21 04:03PM Best Dow Jones Stocks To Buy And Watch In Marc...
7 Mar-19-21 01:02PM The Nasdaq's on the Rise Friday, and These 2 S...
Attempt:
df['Time'] = [x[-7:] for x in df['Date']]
df['Date'] = [x[:-7] for x in df['Date']]
# Some code that fills the date
# Then convert to datetime