Search code examples
pythonazureazure-machine-learning-service

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


I am getting the following error when I try to convert a datetime variable to date.

My Code

import datetime as dt 

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

Error

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

Can anyone please tell me what is going on.


Solution

  • Please try to use the code below to convert as you want.

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

    Hope it helps.