August 2018
Intermediate to advanced
90 pages
1h 57m
English
Another data cleaning task we need to do is convert the Date column from an object or text format to a date-time format. We use the pandas to_datetime method to do this.
Here, we ask the to_datetime method to convert the Date field or price DataFrame, and we also supply the format. We then assign the Date field back to the DataFrame, as shown in the following screenshot:

This is the reason that we set the chained assignment as equal to null earlier, because we wanted to make the changes back on the original DataFrame.
Call the info() method again to see whether the data cleanup has an impact. We can see that the Date field is ...
Read now
Unlock full access