May 2019
Beginner
170 pages
4h 9m
English
The pickup time (pickup_datetime) can be considered a feature, and can be further deconstructed into disparate components such as day of the week, month, hour, minute, and Boolean indicators, such as whether the datetime is a weekday or not, as shown in the following screenshot. add_datepart() is a convenience method in the fastai.structured module adds most of these components for us:
add_datepart(df, 'lpep_pickup_datetime', time=True)df.tail().T
When we execute the preceding lines of codes, a host of datetime components are added to our DataFrame. The resulting DataFrame has a few extra columns, as we can see in the following snapshot of the DataFrame:
Read now
Unlock full access