0 / 8 activities
APPLIED STATISTICS

Descriptive Analysis in Python: 7 Essential Metrics for Better Insights

Practice Descriptive Analysis in Python on service tickets. Calculate seven statistical measures, compare two support centers, and identify where unusually long cases deserve closer review.

StatisticsPython · pandasDescriptive analysis
Start the project →
Descriptive Analysis in Python workflow showing service duration records, measures of center and spread, and a distribution comparison
01

The real-world scenario

Read the business brief before touching the code.

BUSINESS BRIEF

At Meridian Helpdesk, a fictional customer support provider, two service centers handle routine account requests and technical problems. Management currently ranks the centers by average handling time. The North supervisor says the daily workload feels predictable, while South reports that most cases finish quickly but a handful occupy agents for much longer. If management relies on one average, it may reward the wrong process or fail to notice a queue of difficult cases. The operations director wants a fair picture of the service experience before approving a change to staffing.

The team has exported 300 completed tickets, with 150 from each center. The file contains a unique ticket identifier, the center name and elapsed service minutes recorded as whole numbers. Every completed ticket should have a positive duration. Management defines an exception as a case that takes strictly more than 40 minutes. You must retain genuine long cases instead of deleting them just because they are unusual. The file does not contain customer identities, case complexity, staffing levels or arrival times, so it cannot explain the cause of delays on its own.

Your deliverable is a reproducible summary of typical handling time, variation and distribution shape, both across all tickets and by center. Which center should receive a closer process review, and why might the average alone lead to a misleading decision? Explain the evidence in language that a service manager can use.

02

Your role

YOUR ASSIGNMENT

Operations Data Analyst

You are the operations data analyst reporting to the service director. Your first responsibility is to establish what one row represents and confirm that durations are comparable across centers. Check the ticket identifiers, missing durations and impossible values before calculating statistics. Decide how to represent typical performance when some cases take much longer than others. Do not assume that an extreme observation is an error.

Prepare a Python report containing seven descriptive measures, an operational exception rate and a center-level comparison. Explain why the sample variance convention is used, what the distribution shape suggests, and how the results support a targeted review. Your findings must distinguish observed patterns from unproven explanations so the director can decide what evidence to collect next.

03

Identify the problem

What is the core service reporting problem, and which statistical method would you use?

Identify the business outcome, suitable technique and why you would choose it.

04

Investigate

Ask the right questions before developing your solution.

Q01What exactly counts as a service observation?

One row represents one completed ticket, not one customer, one agent or one working day. Each service_minutes value measures elapsed handling time using the same unit. A 30-minute ticket contributes one observation just as a 10-minute ticket does. Confirm that a ticket identifier occurs only once and that the two centers use the same timing definition. The requested report covers completed cases in this file, so unfinished cases or future demand are outside its scope. Management also defines an exception as strictly greater than 40 minutes, not greater than or equal to 40. This rule should be applied uniformly.

Q02Which data-quality checks should we perform?

Inspect the three fields and confirm that the duration is numerical, present and positive. A duplicated ticket identifier can accidentally give one case extra weight, while missing values may be ignored by pandas statistics unless you explicitly check them. Keep valid unusual durations: a 90-minute service case could be a real operational issue rather than a mistake. Ask the service team to validate questionable timestamps before making any exclusions. The supplied file contains comparable whole-minute values and unique identifiers. Preserve the center labels because the pooled summary alone cannot reveal which location contributes the longer tail.

Q03Why use seven statistics rather than only the mean?

The mean balances total handling minutes across tickets, while the median describes the middle ranked observation and the mode identifies the most frequent value. Variance and standard deviation quantify spread, with standard deviation expressed in the original unit. Skewness measures asymmetry, and excess kurtosis reflects standardized fourth-moment behavior, especially the influence of extreme values. A center may have a fast median but occasional very slow tickets, so these measures work together. Use sample variance with ddof equal to one for this exercise and pandas adjusted shape measures. Always interpret these values alongside the distribution and the business definition of an exception.

Q04How can we verify that the summaries are sensible?

Check that the two center counts add up to the overall count, and that the overall mean equals the count-weighted average of the center means. The standard deviation squared should equal the variance when both use the same sample denominator. A histogram provides a visual check for unusual asymmetry and extreme values. Verify the exception rate directly by counting cases above 40 minutes and dividing by the relevant ticket count. Keep full precision for computation and round only for display. Do not interpret a near-zero skewness or kurtosis as a formal proof of normality, and do not confuse a descriptive measure with prediction accuracy.

Q05How should management use the findings?

Compare the typical service time and the frequency of exceptions before deciding which center needs attention. A lower median can coexist with higher variability, so changing the whole process based on average time may harm cases that already run efficiently. Prioritize the center with the higher observed late percentage and review the actual tickets that exceeded 40 minutes. Collect case complexity, escalation and staffing information to understand the reasons. Repeat the same descriptive analysis after any improvement and compare like-for-like case groups. The current dataset can identify a pattern and suggest where to investigate, but it cannot establish why the pattern exists.

05

Project resources

service_times.csv

CSV · 300 completed service tickets · 3 fields

Download dataset ↓
First five completed tickets in file order.
ticket_idcenterservice_minutes
T001North25
T002North20
T003North27
T004North28
T005North16

ticket_id: unique completed-ticket identifier · center: North or South · service_minutes: elapsed whole minutes; exception = strictly above 40 minutes.

06

Topic Lesson — Descriptive Analysis in Python

Explore the topic through interactive visual learning.

TOPIC LESSON
01 / 10
FOUNDATIONS

Seven measures, one distribution

Descriptive Analysis in Python converts a list of observations into understandable statistics. Mean, median and mode describe different kinds of typical values. Variance and standard deviation measure the spread around the mean. Skewness measures asymmetry, while excess kurtosis describes standardized fourth-moment behavior and sensitivity to extremes. The input is a numeric Series and the outputs are numerical summaries. Together, these statistics help you see features that an average alone may conceal.

Center → Spread → Shape
300 service timesCenter: 3 measuresSpread: 2 measuresShape: 2 measures
Key takeaway: A complete summary combines center, spread and shape.
1 / 10 slides explored
07

Build the solution

Complete the missing Python operations and run your analysis.

Summarize and compare service durations

Fill each blank with one Python identifier. Use the hint beside a line when you need a clue. The dataset loads automatically when you submit your code.

service_analysis.py0 / 25 filled
01 # Import the table toolkit for the analysis.
import as pd
03 # Load the service log into a table.
df = pd.("service_times.csv")
05 # Verify that a ticket is not counted twice.
assert df["ticket_id"]., "Duplicate ticket IDs"
07 # Select the numeric service duration.
times = df.
09 # Check that every duration is present.
assert times.().all(), "Missing durations"
11 # Check the valid range of elapsed minutes.
assert times.(0).all(), "Nonpositive duration"
13 # Record the number of usable durations.
n = times.()
15 # Calculate the arithmetic center.
mean = times.()
17 # Calculate the rank-based center.
median = times.()
19 # Find every most frequent duration.
modes = times.().tolist()
21 # Calculate sample variance.
variance = times.(ddof=1)
23 # Calculate sample standard deviation.
std = times.(ddof=1)
25 # Measure the direction of asymmetry.
skew = times.()
27 # Measure standardized fourth-moment tail behavior.
kurt = times.()
29 # Check agreement between spread measures.
assert (std ** 2 - variance) < 1e-9, "Variance mismatch"
31 # Flag tickets exceeding forty minutes.
late = times.(40)
33 # Convert the exception flags into a percentage.
late_rate = late.() * 100
35 # Prepare center-level summaries.
groups = df.("center")["service_minutes"]
37 # Calculate comparable center-level summaries.
summary = groups.(["count", "mean", "median", "std", "var", "skew"])
39 # Add Fisher excess kurtosis by center.
summary["kurtosis"] = groups.(lambda s: s.kurt())
41 # Add all tied modes for each center.
summary["mode"] = groups.apply(lambda s: s.().tolist())
43 # Calculate the exception rate separately for each center.
summary["late_pct"] = groups.apply(lambda s: s.gt(40).() * 100)
45 # Choose the center with the highest exception rate.
priority = summary["late_pct"].()
47 # Display the count and measures of center.
print("Tickets:", n, "| Mean:", round(mean, 2), "| Median:", round(median, 2), "| Mode:", )
49 # Display spread, shape, exception rates and the review priority.
print("Variance:", round(variance, 2), "| SD:", round(std, 2), "| Skew:", round(skew, 2), "| Excess kurtosis:", round(kurt, 2), "| Late %:", round(late_rate, 2), "\n", summary.(2).to_string(), "\nReview priority:", priority)
08

End of the lesson

Reflect on your learning experience.

How was your learning experience?

Select a rating

Recommended resource

Explore additional learning resources to deepen your understanding.

Descriptive Analysis in Python learning illustration
UDEMY · COURSE RESOURCE

Data Analytics, Data Science, ML, DL & NLP - All in 1 Course

A Udemy course covering Python data analysis, statistics, machine learning, deep learning and natural language processing.

View the complete course →