Practical Exercises Chapter 10
Practical exercises are a great way for you to solidify your understanding of the concepts. Here are some exercises focusing on visual exploratory data analysis, along with their solutions.
Exercise 1: Univariate Analysis with Histograms
Task: Given a dataset of exam scores for students, plot a histogram to understand the distribution of scores.
# Sample data: Exam scores of 50 students
exam_scores = [55, 80, 74, 61, 90, 85, 68, 95, 60, 66, 70, 99, 53, 79, 62, 89, 75, 69, 94, 71, 83, 88, 57, 45, 73, 91, 76, 84, 64, 58, 98, 63, 78, 92, 82, 77, 72, 65, 59, 86, 87, 67, 46, 93, 81, 97, 54, 50, 96, 100]
# Your code here
Solution
import matplotlib.pyplot as plt
plt.hist(exam_scores, bins=10, color='blue', edgecolor='black')
plt.xlabel('Exam Scores')
plt.ylabel('Frequency')
plt.title('Distribution of Exam Scores')
plt.show()
Exercise 2: Bivariate Analysis with Scatter Plot
Task: Create a...