Extract Calendar Year From Timestamps in a pandas Series
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Write a pandas function that takes a datetime Series and returns each row's calendar year as int32 while keeping the original index and name. It tests the .dt accessor, explicit dtype casting that holds across pandas versions, and awareness of missing or timezone-aware timestamps.