I am trying to replace an NaT value in a formatted datetime column with the date from another column.
I.e. if column [2] (Description_Date) shows NaT, return date in that column with the date in column [0] (PostingDate)
PostingDate Day of Week Description_Date
0 2023-02-28 Tuesday NaT
0 2023-02-28 Tuesday NaT
0 2023-02-28 Tuesday NaT
0 2023-02-28 Tuesday NaT
0 2023-02-28 Tuesday NaT
5 2023-02-28 Tuesday 2023-02-24
6 2023-02-28 Tuesday 2023-02-20
I have tried to used the following code to replace NaT with the value from PostingDate:
column:df['Description_Date'].replace('NaT', df.loc[df['PostingDate']])
I receive this error dtype='datetime64[ns]', length=499, freq=None)] are in the [index]