Extract Year, Month, and Weekday
Using the dt accessor for features.
A Timestamp Holds a Lot
One datetime value packs a year, month, day, hour, and weekday inside it. The skill is pulling each piece out as its own column for analysis. 🧩
Meet the dt Accessor
On a datetime column, the dt accessor is your gateway. It exposes every date part as a simple attribute you can read or assign.
df["date"].dt # gateway to date partsAll lessons in this course
- Parse Strings Into Datetimes
- Extract Year, Month, and Weekday
- Resample to Daily or Monthly
- Time Zones and Date Ranges