1.Mean or median?
IntermediateHouse prices (₹ lakh) in a street are [55, 60, 58, 62, 57, 300]. Print the mean, the median and the IQR (1 decimal each). Which is the better "typical price"?
Show hint
mean(), median(), and quantile(0.75) - quantile(0.25).
Show solution
import pandas as pd
prices = pd.Series([55, 60, 58, 62, 57, 300])
print(round(prices.mean(), 1), prices.median())
print(round(prices.quantile(0.75) - prices.quantile(0.25), 1))98.7 59.0
4.2One mansion pulls the mean to 98.7 while the median, 59, reflects the typical house. The median is the better summary here.