Skip to content
CampusEduX

Problem 4: Visualize Outliers with a Boxplot

Easypython
Learn the Concept: Outlier Detection

Problem Description

Write a Python program that creates a boxplot for a given list of numbers using Matplotlib, to visually display the presence of any outliers.

Input

A list of numbers containing at least one clear outlier.

Output

A displayed boxplot showing the data's distribution and any outlier points.

Constraints

  • The list will contain at least 6 numbers.

Example Input

text
[15, 18, 16, 17, 19, 90]

Example Output

text
(A boxplot window showing most values clustered together, with 90 marked as an outlier point)

Concepts Covered

plt.boxplot(), visual outlier detection.

Related Problems

  • Problem 1: Detect Outliers Using the IQR Method
    Easy · python
    Solve Problem
  • Problem 2: Detect Outliers Using the Z-score Method
    Easy · python
    Solve Problem
  • Problem 3: Remove Outliers from a Dataset
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...