Exercise

Parse non-standard date formats

So far, you've parsed dates that pandas could interpret automatically. But if a date is in a non-standard format, like 19991231 for December 31, 1999, it can't be parsed at the import stage. Instead, use pd.to_datetime() to convert strings to dates after import.

The New Developer Survey data has been loaded as survey_data but contains an unparsed datetime field. We'll use to_datetime() to convert it, passing in the column to convert and a string representing the date format used.

For more on date format codes, see this reference. Some common codes are year (%Y), month (%m), day (%d), hour (%H), minute (%M), and second (%S).

pandas has been imported as pd.

Instructions 1/3

undefined XP
    1
    2
    3

Question

In the console, examine survey_data's Part2EndTime column to see the data type and date format. Choose the code that describes the date format in Part2EndTime.

Possible answers