0
0
Data Analysis Pythondata~30 mins

Jupyter Notebook best practices in Data Analysis Python - Mini Project: Build & Apply

Choose your learning style9 modes available
Jupyter Notebook Best Practices
📖 Scenario: You are working as a data analyst and want to create a clean, readable Jupyter Notebook to share your data analysis with your team.
🎯 Goal: Build a simple Jupyter Notebook structure that follows best practices: create data, add a configuration variable, apply a simple analysis, and display the results clearly.
📋 What You'll Learn
Create a dictionary called sales_data with exact monthly sales values
Add a variable called threshold to filter high sales months
Use a dictionary comprehension to create high_sales with months exceeding the threshold
Print the high_sales dictionary to show filtered results
💡 Why This Matters
🌍 Real World
Data analysts often use Jupyter Notebooks to explore and share data insights. Following best practices helps keep notebooks clean and easy to understand.
💼 Career
Knowing how to organize data, use configuration variables, apply filtering logic, and display results clearly is essential for data science and analytics roles.
Progress0 / 4 steps
1
DATA SETUP: Create the sales data dictionary
Create a dictionary called sales_data with these exact entries: 'January': 1500, 'February': 1800, 'March': 1200, 'April': 2200, 'May': 1700.
Data Analysis Python
Hint

Use curly braces {} to create a dictionary with the given month names as keys and sales numbers as values.

2
CONFIGURATION: Add a sales threshold variable
Add a variable called threshold and set it to 1600 to filter months with sales above this value.
Data Analysis Python
Hint

Just create a variable named threshold and assign the number 1600 to it.

3
CORE LOGIC: Filter months with high sales
Use a dictionary comprehension to create a new dictionary called high_sales that contains only the months from sales_data where the sales value is greater than threshold.
Data Analysis Python
Hint

Use {month: sales for month, sales in sales_data.items() if sales > threshold} to filter the dictionary.

4
OUTPUT: Display the filtered high sales months
Print the high_sales dictionary to display the months with sales above the threshold.
Data Analysis Python
Hint

Use print(high_sales) to show the filtered dictionary.