The CRM adds a new row every time a customer changes something. Keep only each customer's latest row (by updated_at), sorted by customer_id with a fresh index, and store it in result.
import pandas as pd
crm = pd.DataFrame({
"customer_id": ["C1", "C2", "C1", "C3", "C2", "C1", "C4"],
"city": ["Pune", "Delhi", "Mumbai", "Jaipur", "Delhi", "Mumbai", "Pune"],
"plan": ["Basic", "Gold", "Silver", "Basic", "Silver", "Gold", "Basic"],
"updated_at": pd.to_datetime(["2025-01-10", "2025-01-15", "2025-03-02", "2025-02-11", "2025-04-20", "2025-05-05", "2025-03-30"]),
})Store your final answer in a variable named result.
Each hint gives a little more help. Try on your own first.
Run your code to see the output here.