Loading, please wait...
🚀 Now Available on Google Play

VTU Circle

Your complete VTU student companion. Check VTU results, track SGPA & CGPA, access study resources, stay updated with VTU notifications, and connect with classmates—all in one simple and fast app.

📊 VTU Results 🎯 SGPA & CGPA 📄 Result PDF 📈 Analytics 📚 Notes 📖 Syllabus 📝 Question Papers 🛠 Study Tools 🔔 VTU Updates 🏆 Rankings 👥 Classmates 💬 Chat
Download on Google Play

BAD702 Program 1

1. A dataset contains the prices of houses in a city. Find the 25th and 75th percentiles and calculate the interquartile range (IQR). How does the IQR help in understanding the price variability?

PROGRAM:

import numpy as np

# Example dataset of house prices
house_prices = [250000, 300000, 320000, 350000, 400000, 420000, 450000, 500000, 550000, 600000]

# Calculate the 25th percentile (Q1)
q1 = np.percentile(house_prices, 25)

# Calculate the 75th percentile (Q3)
q3 = np.percentile(house_prices, 75)

# Calculate the Interquartile Range (IQR)
iqr = q3 - q1

# Print results
print("25th percentile (Q1):", q1)
print("75th percentile (Q3):", q3)
print("Interquartile Range (IQR):", iqr)

OUTPUT:

25th percentile (Q1): 327500.0
75th percentile (Q3): 487500.0
Interquartile Range (IQR): 160000.0
guest
0 Comments
0
Would love your thoughts, please comment.x
()
x
Syllabus Papers
SGPA CGPA