0
0
Data Analysis Pythondata~30 mins

Web analytics data pattern in Data Analysis Python - Mini Project: Build & Apply

Choose your learning style9 modes available
Web analytics data pattern
📖 Scenario: You work as a data analyst for a website. You have daily visitor counts for a week. You want to find which days had visitor counts above a certain threshold to understand busy days.
🎯 Goal: Build a small program that stores daily visitor counts, sets a threshold, finds days with visitors above that threshold, and prints those days with their counts.
📋 What You'll Learn
Create a dictionary with exact day names as keys and visitor counts as values
Create a variable for the visitor threshold
Use a dictionary comprehension to find days with visitors above the threshold
Print the resulting dictionary of busy days
💡 Why This Matters
🌍 Real World
Web analysts often need to find patterns in visitor data to understand peak usage days and plan resources accordingly.
💼 Career
This skill helps data analysts and marketers identify important trends and make data-driven decisions for website improvements.
Progress0 / 4 steps
1
Create the daily visitors dictionary
Create a dictionary called daily_visitors with these exact entries: 'Monday': 120, 'Tuesday': 85, 'Wednesday': 150, 'Thursday': 90, 'Friday': 200, 'Saturday': 75, 'Sunday': 110.
Data Analysis Python
Hint

Use curly braces {} to create a dictionary. Put day names as keys and visitor counts as values.

2
Set the visitor threshold
Create a variable called visitor_threshold and set it to 100.
Data Analysis Python
Hint

Just assign the number 100 to the variable visitor_threshold.

3
Find busy days using dictionary comprehension
Use a dictionary comprehension to create a new dictionary called busy_days that contains only the days from daily_visitors where the visitor count is greater than visitor_threshold. Use day and count as the loop variables.
Data Analysis Python
Hint

Use {day: count for day, count in daily_visitors.items() if count > visitor_threshold} to filter days.

4
Print the busy days dictionary
Write a print statement to display the busy_days dictionary.
Data Analysis Python
Hint

Use print(busy_days) to show the filtered dictionary.