'Timedelta' object has no attribute 'dt' code example
Example: type object 'datetime.datetime' has no attribute 'timedelta'
# Use either
import datetime
datetime.datetime.timedelta()
# or
from datetime import datetime
datetime.timedelta()
# But do not use (as you currently are):
from datetime import datetime
datetime.datetime.timedelta()