Branches typed prices like ₹1,200, Rs. 850 and free. Remove ₹, Rs., Rs, commas and spaces, treat free as 0, and convert to numbers.
Store the total of all prices in result (a float).
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.