weight mixes kilograms and grams, with or without a space and in any case (1.2 kg, 800 g, 3 KG). Convert every weight to kilograms as a float.
Store the converted Series in result.
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.