python中的datetime抛出值错误

2024-09-28 17:02:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在python中转换dataframe中列的datetime格式 原始日期-2018年7月16日00:00 最终日期-2018-08-16 00:00

results['Date1']=dt.datetime.strptime(str(results['Date']), "%d-%b-%Y %H:%M").strftime("%Y-%m-%d %H:%M")

但它给了我价值观上的错误。在syntex中尝试特定字符串时,它是有效的 enter image description here


Tags: 字符串dataframedatetimedate格式错误dtresults