'Trouble in pandas library while generating a new column

I'm trying to Generate a new column "Delay" from the existing columns. And I'm getting this error. Error in code



Solution 1:[1]

Looks like you need to convert your due_in_date column to datetime dtype.

dtrain['due_in_date'] = pd.to_datetime(dtrain['due_in_date'])

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Matthew Borish