Add integer year and month columns from a datetime column in pandas
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Add integer year and month columns to a pandas DataFrame from an existing datetime column without changing the input frame. It tests the .dt accessor, copying a DataFrame before adding columns, integer dtypes and what happens when some dates are missing.