Bird
0
0

You have a 2D NumPy array representing exam scores of 3 students in 4 subjects:

hard📝 Application Q8 of 15
SciPy - Statistical Functions (scipy.stats) Basics
You have a 2D NumPy array representing exam scores of 3 students in 4 subjects:
import numpy as np
from scipy.stats import describe
scores = np.array([[80, 90, 70, 85], [75, 85, 80, 90], [90, 95, 85, 100]])
stats = describe(scores, axis=1)
print(stats.mean)

What does stats.mean represent here?
AAn array of mean scores for each student across subjects
BThe overall mean score of all students and subjects
CThe mean score for each subject across all students
DThe mean of the first student's scores only
Step-by-Step Solution
Solution:
  1. Step 1: Understand axis parameter

    Using axis=1 means describe calculates stats across columns for each row (student).
  2. Step 2: Interpret mean output

    stats.mean is an array with mean scores per student across their subjects.
  3. Final Answer:

    An array of mean scores for each student across subjects -> Option A
  4. Quick Check:

    Axis=1 means row-wise stats [OK]
Quick Trick: Axis=1 computes stats per row [OK]
Common Mistakes:
MISTAKES
  • Confusing axis=1 with axis=0
  • Thinking mean is overall scalar
  • Assuming mean is per subject

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes