What is the difference between mean(), median(), and mode() in statistics?

94 views

What is the difference between mean(), median(), and mode() in statistics?

What is the difference between mean()median(), and mode() in statistics?

solveurit24@gmail.com Changed status to publish February 13, 2025
0
  • Mean: The average of the numbers.
  • Median: The middle value in a sorted list of numbers.
  • Mode: The most frequently occurring value in a dataset.

Example:

import numpy as np
from scipy import stats

arr = [1, 2, 2, 3, 4, 4, 4]

# Mean
print(np.mean(arr))  # Output: 3.0

# Median
print(np.median(arr))  # Output: 3.0

# Mode
print(stats.mode(arr).mode[0])  # Output: 4

solveurit24@gmail.com Changed status to publish February 13, 2025
0
You are viewing 1 out of 1 answers, click here to view all answers.