Bird
0
0

What is the output of this code?

medium📝 Predict Output Q4 of 15
SciPy - Statistical Functions (scipy.stats) Basics
What is the output of this code?
from scipy.stats import uniform
rv = uniform(loc=3, scale=7)
print(rv.mean())
A7.0
B3.5
C6.5
D10.0
Step-by-Step Solution
Solution:
  1. Step 1: Recall mean formula for uniform distribution

    Mean = loc + scale / 2.
  2. Step 2: Calculate mean with loc=3 and scale=7

    Mean = 3 + 7/2 = 3 + 3.5 = 6.5.
  3. Final Answer:

    6.5 -> Option C
  4. Quick Check:

    Mean = loc + scale/2 = 6.5 [OK]
Quick Trick: Mean = loc plus half scale [OK]
Common Mistakes:
MISTAKES
  • Using loc or scale alone as mean
  • Adding loc and scale instead of half scale
  • Confusing mean with median

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes