The datetime format for December 31st, 2020 is timezone-naive, while all other dates are timezone-aware (see picture). As such, when creating a datetime object, an error occurs. The following example may be a way to fix the issue, as it ensures a desired time format for all dates.
The datetime format for December 31st, 2020 is timezone-naive, while all other dates are timezone-aware (see picture). As such, when creating a datetime object, an error occurs. The following example may be a way to fix the issue, as it ensures a desired time format for all dates.
transform_datetime = lambda x: pd.to_datetime(x, format='mixed').strftime('%Y-%m-%d %H:%M:%S') df_t_aia['Time'] = df_t_aia['Time'].apply(transform_datetime)