我尝试执行以下代码
date1 = datetime.strptime(str(dataMin), '%Y-%m-%d %H:%M:%S')
date2 = datetime.strptime(str(dataAtual), '%Y-%m-%d %H:%M:%S')
r = relativedelta.relativedelta(date2, date1)
问题在于dataMin
的值为Timestamp('2019-05-03 00:00:00')
,而dataAtual
的值为datetime.datetime(2020, 1, 8, 8, 51, 16, 627867)
然后我收到此错误
ValueError: ('unconverted data remains: .627867', 'occurred at index (BTRBZZ00, BT#R0010, Q, E1)')