Challenge - 5 Problems
Aggregation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of sum aggregation on DataFrame column
What is the output of the following code snippet?
Data Analysis Python
import pandas as pd df = pd.DataFrame({'values': [10, 20, 30, 40]}) result = df['values'].sum() print(result)
Attempts:
2 left
💡 Hint
Sum adds all numbers in the column.
✗ Incorrect
The sum of 10 + 20 + 30 + 40 equals 100.
❓ data_output
intermediate2:00remaining
Mean value of grouped data
Given the DataFrame below, what is the mean value of group 'B'?
Data Analysis Python
import pandas as pd df = pd.DataFrame({'group': ['A', 'B', 'B', 'A', 'B'], 'score': [5, 10, 15, 20, 25]}) mean_b = df.groupby('group')['score'].mean().loc['B'] print(mean_b)
Attempts:
2 left
💡 Hint
Mean is the sum divided by count for group 'B'.
✗ Incorrect
Group 'B' has scores 10, 15, and 25. Their mean is (10+15+25)/3 = 16.666666666666668.
❓ Predict Output
advanced2:00remaining
Standard deviation calculation on a list
What is the output of this code?
Data Analysis Python
import numpy as np values = [2, 4, 4, 4, 5, 5, 7, 9] std_dev = np.std(values, ddof=1) print(round(std_dev, 2))
Attempts:
2 left
💡 Hint
ddof=1 means sample standard deviation.
✗ Incorrect
Sample standard deviation of the list is approximately 2.14 after rounding.
❓ visualization
advanced2:00remaining
Interpreting aggregation results in a bar chart
You have this code that plots mean scores by category. What does the bar height for category 'X' represent?
Data Analysis Python
import pandas as pd import matplotlib.pyplot as plt df = pd.DataFrame({'category': ['X', 'Y', 'X', 'Y', 'X'], 'score': [3, 7, 5, 9, 4]}) mean_scores = df.groupby('category')['score'].mean() mean_scores.plot(kind='bar') plt.show()
Attempts:
2 left
💡 Hint
The code uses mean aggregation.
✗ Incorrect
The bar height shows the mean (average) score for category 'X', calculated from scores 3, 5, and 4.
🧠 Conceptual
expert2:00remaining
Understanding difference between population and sample std deviation
Which statement correctly explains the difference between population and sample standard deviation calculations?
Attempts:
2 left
💡 Hint
Think about degrees of freedom in statistics.
✗ Incorrect
Sample std deviation uses (n-1) in denominator to correct bias when estimating from a sample; population uses n.