0
0
Pandasdata~30 mins

Exploratory data analysis workflow in Pandas - Mini Project: Build & Apply

Choose your learning style9 modes available
Exploratory data analysis workflow
📖 Scenario: You are a data analyst working with sales data from a small store. You want to understand the data better by exploring it step-by-step.
🎯 Goal: Build a simple exploratory data analysis workflow using pandas to load data, set a filter, analyze the filtered data, and print the results.
📋 What You'll Learn
Use pandas to create a DataFrame
Create a filter condition variable
Use the filter to select rows
Calculate the average sales from filtered data
Print the average sales
💡 Why This Matters
🌍 Real World
Exploratory data analysis helps businesses understand their sales data to make better decisions.
💼 Career
Data analysts and scientists use these skills daily to clean, filter, and summarize data before deeper analysis.
Progress0 / 4 steps
1
Create the sales data DataFrame
Import pandas as pd and create a DataFrame called sales_data with these exact columns and values:
'Product': ['Apples', 'Bananas', 'Cherries', 'Dates', 'Elderberries'],
'Sales': [100, 150, 80, 200, 50],
'Region': ['North', 'South', 'East', 'West', 'North'].
Pandas
Need a hint?

Use pd.DataFrame with a dictionary of lists for columns.

2
Set a filter for the North region
Create a variable called north_filter that holds a filter condition selecting rows where the 'Region' column equals 'North'.
Pandas
Need a hint?

Use sales_data['Region'] == 'North' to create the filter.

3
Calculate average sales for North region
Use the north_filter to select rows from sales_data and calculate the average of the 'Sales' column. Store this average in a variable called average_sales_north.
Pandas
Need a hint?

Use sales_data.loc[north_filter, 'Sales'].mean() to get the average.

4
Print the average sales for North region
Write a print statement to display the text "Average sales in North region:" followed by the value of average_sales_north.
Pandas
Need a hint?

Use print("Average sales in North region:", average_sales_north).