- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Data
Analyze a Dataset with Descriptive Statistics
In this lab, you'll explore a real-world dataset using Python to uncover how its values are distributed. You'll calculate summary statistics, build visualizations, and learn to describe a dataset's center, spread, and shape with confidence. By the end, you'll have a repeatable workflow for characterizing any tabular dataset before deeper analysis.
Lab Info
Table of Contents
-
Challenge
Step 1: Load and inspect the dataset
Descriptive statistics turn raw rows and columns into a profile you can explain to stakeholders. In this lab, you will build that profile for an employee compensation dataset using Python, pandas, and matplotlib.
You will work in a single analysis script that loads a CSV file, computes summary statistics, saves distribution charts, and prints an interpretation you can share with a people analytics team. The lab's codebase lives in the
applicationdirectory. It already includesanalyze.py,data/employees.csv, and anoutput/folder for saved charts. To begin, you will load the dataset and confirm its structure before adding any calculations.Feeling stuck? Check out the matching
solution/stepN/folder for the step you're on to see a working implementation. Give it a try on your own first. The solution folder is your safety net, not your starting point. info> This lab experience was developed by the Pluralsight team using an internally developed AI tool. All sections were verified by human experts for accuracy prior to publications. However, content may still contain errors or inaccuracies, and we recommend independent verification.
To report a problem or provide feedback, click here. Feedback may be used to improve accuracy in accordance with our Privacy Policy. -
Challenge
Step 2: Calculate measures of central tendency
Your script now loads the compensation dataset and reports its structure. That inspection step confirms which columns are numeric and ready for statistical summaries.
Here, you will add mean, median, and mode calculations for columns such as
salary,years_experience, andperformance_rating. Each measure highlights a different view of where values cluster in the distribution. -
Challenge
Step 3: Calculate measures of spread
Central tendency shows where values cluster, but spread measures reveal how much variation exists across employees.
In this step, you will add range, variance, and standard deviation calculations for the numeric columns in
NUMERIC_COLUMNS. These metrics quantify how widely compensation and related fields vary. -
Challenge
Step 4: Compute the five-number summary
Center and spread metrics describe a distribution in broad terms. Quartiles let you describe shape more precisely and flag unusual values.
You will add the five-number summary and interquartile range for the numeric columns, then use the 1.5 Ă— IQR rule to identify potential salary outliers.
-
Challenge
Step 5: Visualize distributions
Summary statistics quantify distribution characteristics, but charts make skewness and spread easier to communicate.
You will add matplotlib visualizations that save histograms and box plots for the numeric columns in
NUMERIC_COLUMNS. The saved files will complement the numeric summaries from earlier steps. -
Challenge
Step 6: Interpret the analysis
Your script now computes statistics and saves charts. The final piece is a written summary that connects those numbers and visuals into a coherent dataset characterization.
You will add an interpretation section that describes center, spread, and skewness for the compensation dataset, then run the completed script to review the full analysis end to end.
-
Challenge
Lab Complete
You built a descriptive statistics workflow in Python that characterizes an employee compensation dataset from first load through final interpretation.
You loaded and inspected a CSV with pandas, calculated measures of central tendency and spread, computed quartiles and outlier fences, saved histogram and box plot visualizations, and synthesized those findings into a stakeholder-ready summary. These skills form a repeatable first pass you can apply to any tabular dataset before deeper modeling or inference work.
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.