Azure ML- 执行 Python 脚本 -Datatime.date 不工作

Azure ML- Execute Python Script -Datatime.date not working

当我尝试将日期时间变量转换为日期时出现以下错误。

我的代码

import datetime as dt 

df['TXN_DATE_2'] = df['TXN_DATE'].dt.date

错误

raise NotImplementedError('Python Bridge conversion table not implemented for type [{0}]'.format(value.getType())) NotImplementedError: Python Bridge conversion table not implemented for type [] Process returned with non-zero exit code 1

谁能告诉我这是怎么回事。

请尝试使用下面的代码进行转换。

import pandas as pd
import datetime as dt
df['TXN_DATE_2'] = pd.to_datetime(df['TXN_DATE']).dt.date

希望对您有所帮助。