start_date
end_date
...
'2024-05-31'
'2024-06-13'
...
'2024-03-27'
'2024-03-27'
...
'2023-12-07'
'2023-12-19'
...
...
...
...
Моя текущая стратегия преобразует str в datetime64, и для обработки ~430 тыс. строк требуется ~4:30.
Код: Выделить всё
for col in ['start_date', 'end_date']:
df[col] = df[col].apply(lambda x: pd.to_datetime(x))
Подробнее здесь: https://stackoverflow.com/questions/798 ... df-at-once
Мобильная версия