Recall & Review
beginner
What is Date feature extraction in data analysis?
Date feature extraction means taking a date and pulling out useful parts like the year, month, day, or weekday to help understand or predict patterns.
Click to reveal answer
beginner
How can you extract the month from a date column in Python using pandas?
Use
df['date_column'].dt.month to get the month number (1 to 12) from each date in the column.Click to reveal answer
beginner
Why might extracting the weekday from a date be useful in data analysis?
Weekdays can show patterns like higher sales on weekends or different behaviors on weekdays, helping models learn better.
Click to reveal answer
intermediate
What pandas attribute helps to extract the day of the week as a name (e.g., Monday)?
Use
df['date_column'].dt.day_name() to get the weekday name from dates.Click to reveal answer
intermediate
How do you extract the quarter of the year from a date in pandas?
Use
df['date_column'].dt.quarter to get the quarter number (1 to 4) from each date.Click to reveal answer
Which pandas attribute extracts the year from a datetime column?
✗ Incorrect
The
dt.year attribute extracts the year part from datetime values.What does
df['date'].dt.weekday return?✗ Incorrect
The
dt.weekday returns the day of the week as an integer where Monday is 0.Which extracted date feature can help identify seasonal trends?
✗ Incorrect
The quarter of the year groups months into seasons, helping spot seasonal trends.
How do you get the weekday name from a pandas datetime column?
✗ Incorrect
Use
dt.day_name() to get the weekday as a string like 'Monday'.Why is date feature extraction important in data science?
✗ Incorrect
Extracting date parts turns dates into useful numeric or categorical features for models.
Explain how you would extract useful features from a date column in a dataset using pandas.
Think about the parts of a date that might affect your data patterns.
You got /5 concepts.
Describe why extracting the weekday or quarter from dates can improve a predictive model.
Consider how time affects human activities or business cycles.
You got /4 concepts.