Context. An events table covers several years; you want only the events from one specific year.
Your task. Write rows_in_year(df, year) that returns the rows of df whose date falls in the given year. Keep the date column exactly as it came in.
Example. year=2021 keeps only rows dated in 2021, in their original order.
Notes. Parse the dates to compare years, but don't change the returned date values. No matching rows → empty DataFrame.