Handling dates

In what format should dates and times should be written and how they are handled? In this tutorial we show you how these kind of variables are handled in Arkangel AI.

pandas.to_datetime()
dateutil.parser.parse()

The variables are transformed into datetime objects and then separated by their components, generating much more telling and helpful variables for training the experiment. Also, this form of handling datetime variables is used for inferences, since the variables must be the same when creating an inference.

The datetime components generated are:

Day: the day in numbers that the variable had
Month: the month in numbers the variable had
Year: the year in numbers the variable had
Day of the week: the name of the date of the week (such as Monday, Tuesday, etc...)
Time: the time in minutes after midnight

The formats the datetime strings that can be handled are:

  • ISO 8601 format: '2021-09-30', '2021-09-30 10:30:00', '2021-09-30T10:30:00'

  • Year-month-day format: '2021/09/30', '2021-09-30', '2021.09.30', '20210930'

  • Month-day-year format: '09/30/2021', '09-30-2021', '09.30.2021', '09302021'

  • Day-month-year format: '30/09/2021', '30-09-2021', '30.09.2021', '30092021'

  • Time formats: '10:30:00', '10:30', '10:30:00 AM', '10:30:00 PM'

  • Custom formats using format codes (e.g., %Y-%m-%d, %d/%m/%Y, %m-%d-%Y, %H:%M:%S)

Last updated