Cap minutes at the 1.5 × IQR fences (values outside become the fence). Store the mean of the capped column, rounded to 2 decimals, in result, and compare it with the mean before capping.
import pandas as pd
deliveries = pd.DataFrame({
"order_id": list(range(501, 521)),
"zone": ["North", "South"] * 10,
"minutes": [28, 31, 25, 35, 30, 27, 33, 29, 26, 140, 32, 30, 24, 38, 29, 31, 95, 28, 27, 34],
})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.