1

 import numpy as np


# Sample dataset of house prices (in lakhs)

house_prices = [45, 55, 60, 62, 68, 70, 75, 80, 85, 90, 100, 110, 125]


# Calculate the 25th and 75th percentiles

q1 = np.percentile(house_prices, 25)

q3 = np.percentile(house_prices, 75)


# Calculate the Interquartile Range (IQR)

iqr = q3 - q1


# Print the results

print(f"25th Percentile (Q1): {q1}")

print(f"75th Percentile (Q3): {q3}")

print(f"Interquartile Range (IQR): {iqr}")

Comments

Popular posts from this blog

2

5