Bird
0
0

If arr = np.array([7, 2, 9, 4]), what does np.argmin(arr) return?

easy📝 Conceptual Q2 of 15
NumPy - Aggregation Functions
If arr = np.array([7, 2, 9, 4]), what does np.argmin(arr) return?
A1
B2
C0
D3
Step-by-Step Solution
Solution:
  1. Step 1: Identify the minimum value in the array

    The array is [7, 2, 9, 4]. The smallest value is 2.
  2. Step 2: Find the index of the minimum value

    2 is at index 1.
  3. Final Answer:

    1 -> Option A
  4. Quick Check:

    np.argmin(arr) = 1 [OK]
Quick Trick: np.argmin() returns index of smallest value in array [OK]
Common Mistakes:
  • Choosing the minimum value instead of its index
  • Confusing index positions
  • Using np.min() instead of np.argmin()

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NumPy Quizzes