Head office writes dates as 2025-03-01 (year-month-day), branches write 02/03/2025 (day/month/year). One value is not known.
Parse both formats correctly, keep the unparseable one missing, and store the dates as text in YYYY-MM-DD form in result (a list; the missing one becomes None).
import pandas as pd
shipments = pd.DataFrame({
"ship_id": [1, 2, 3, 4, 5, 6, 7, 8],
"price": ["₹1,200", "Rs. 850", "999", "₹ 2,450.50", "free", "1,100", "Rs 300", "₹75"],
"weight": ["1.2 kg", "800 g", "2kg", "500g", "0.75 kg", "1500 g", "3 KG", "250 g"],
"booked": ["2025-03-01", "02/03/2025", "2025-03-04", "05/03/2025", "2025-03-07", "not known", "09/03/2025", "2025-03-10"],
})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.