Skip to content Skip to sidebar Skip to footer

How To Extract Month And Year From Given Date In Python In Azure Ml

I was working in azure ml for the past few days. I came up with a dataset which consists of date in the below format mm/dd/yyyy hh:mm:ss I want to extract month and year from it

Solution 1:

Use .dt to access the datetime methods.

Ex:

dates = pd.to_datetime(data['Order Date']).dt.strftime('%m-%d-%Y')

Solution 2:

You can use SQL transformation use SQL query to cast your datetime.

Post a Comment for "How To Extract Month And Year From Given Date In Python In Azure Ml"