0
0
Data Analysis Pythondata~20 mins

Survey data analysis pattern in Data Analysis Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Survey Data Analysis Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
data_output
intermediate
2:00remaining
Calculate the average satisfaction score by gender

You have a survey dataset with columns Gender and Satisfaction (scale 1-5). What is the average satisfaction score for each gender?

Data Analysis Python
import pandas as pd

data = pd.DataFrame({
    'Gender': ['Male', 'Female', 'Female', 'Male', 'Female'],
    'Satisfaction': [4, 5, 3, 2, 4]
})

result = data.groupby('Gender')['Satisfaction'].mean()
A{'Female': 4.0, 'Male': 3.0}
B{'Female': 4.0, 'Male': 3.5}
C{'Female': 4.0, 'Male': 2.0}
D{'Female': 4.5, 'Male': 3.0}
Attempts:
2 left
💡 Hint

Use groupby on Gender and then calculate the mean of Satisfaction.

🧠 Conceptual
intermediate
1:30remaining
Identify the correct interpretation of a Likert scale distribution

A survey question uses a 5-point Likert scale (1=Strongly Disagree to 5=Strongly Agree). The distribution of responses is skewed towards 5. What does this indicate?

AResponses are evenly spread across all options.
BMost respondents strongly disagree with the statement.
CMost respondents strongly agree with the statement.
DMost respondents chose the neutral option.
Attempts:
2 left
💡 Hint

Think about what a skew towards 5 means on a 1 to 5 scale.

🔧 Debug
advanced
2:00remaining
Fix the error in filtering survey data by age group

The code below tries to filter respondents aged 30 or older but raises an error. Identify the cause.

Data Analysis Python
import pandas as pd

data = pd.DataFrame({'Age': [25, 30, 35, 40]})

filtered = data[data['Age'] >= 30]
ASyntaxError due to incorrect bracket placement in the filter condition.
BKeyError because 'Age' column does not exist.
CTypeError because comparison is done between string and int.
DNo error; code runs correctly.
Attempts:
2 left
💡 Hint

Check how the condition inside the brackets is written.

visualization
advanced
1:30remaining
Choose the correct plot to show satisfaction distribution by department

You want to visualize how satisfaction scores vary across different departments in a survey. Which plot type is best?

AScatter plot of satisfaction vs. age for all respondents.
BLine plot connecting average satisfaction scores over time.
CPie chart showing percentage of respondents per department.
DBox plot showing satisfaction score distribution per department.
Attempts:
2 left
💡 Hint

Think about showing distribution and comparison across categories.

🚀 Application
expert
1:30remaining
Calculate the response rate from survey data

You have a dataset with 1000 invited participants. The survey data contains 750 rows of responses. How do you calculate the response rate?

AResponse rate = 750 - 1000 = -250
BResponse rate = (750 / 1000) * 100 = 75%
CResponse rate = (1000 / 750) * 100 = 133.33%
DResponse rate = 1000 + 750 = 1750
Attempts:
2 left
💡 Hint

Response rate is the percentage of invited participants who responded.