0
0
Data Analysis Pythondata~30 mins

Survey data analysis pattern in Data Analysis Python - Mini Project: Build & Apply

Choose your learning style9 modes available
Survey Data Analysis Pattern
📖 Scenario: You work for a company that collects customer satisfaction surveys. Each survey has a customer's name and their satisfaction score from 1 to 10. You want to analyze this data to find which customers are satisfied based on a score threshold.
🎯 Goal: Build a simple program that stores survey data, sets a satisfaction threshold, filters customers who meet or exceed this threshold, and prints their names and scores.
📋 What You'll Learn
Create a dictionary with exact customer names and scores
Create a variable for the satisfaction threshold
Use a dictionary comprehension to filter satisfied customers
Print the filtered dictionary
💡 Why This Matters
🌍 Real World
Companies often collect survey data to understand customer satisfaction and improve their services.
💼 Career
Data analysts use similar patterns to filter and analyze survey or feedback data to generate insights.
Progress0 / 4 steps
1
Create the survey data dictionary
Create a dictionary called survey_data with these exact entries: 'Alice': 7, 'Bob': 4, 'Charlie': 9, 'Diana': 6, 'Ethan': 3
Data Analysis Python
Hint

Use curly braces {} to create a dictionary with keys as names and values as scores.

2
Set the satisfaction threshold
Create a variable called threshold and set it to 6 to represent the minimum score for satisfaction
Data Analysis Python
Hint

Just assign the number 6 to a variable named threshold.

3
Filter satisfied customers using dictionary comprehension
Use a dictionary comprehension to create a new dictionary called satisfied_customers that includes only customers from survey_data with scores greater than or equal to threshold
Data Analysis Python
Hint

Use {name: score for name, score in survey_data.items() if score >= threshold} to filter.

4
Print the satisfied customers
Write a print statement to display the satisfied_customers dictionary
Data Analysis Python
Hint

Use print(satisfied_customers) to show the filtered dictionary.