Bird
0
0

Identify the error in this code snippet:

medium📝 Debug Q6 of 15
NumPy - Aggregation Functions
Identify the error in this code snippet:
import numpy as np
arr = np.array([3, 6, 9])
print(np.min arr)
AMissing parentheses after np.min
Bnp.min does not work on arrays
CArray is not defined correctly
Dnp.min should be np.minimum
Step-by-Step Solution
Solution:
  1. Step 1: Check function call syntax

    np.min is a function and requires parentheses to pass the array.
  2. Step 2: Identify the syntax error

    The code misses parentheses after np.min, causing a syntax error.
  3. Final Answer:

    Missing parentheses after np.min -> Option A
  4. Quick Check:

    Functions need parentheses () [OK]
Quick Trick: Always use () to call functions like np.min() [OK]
Common Mistakes:
  • Forgetting parentheses
  • Using wrong function name
  • Incorrect array creation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NumPy Quizzes