Which NumPy function is used to create an array of a specified shape where all…

2026

Which NumPy function is used to create an array of a specified shape where all elements are initialized to the value 0?

Answer: B. np.zeros()

  1. A.

    np.empty()

  2. B.

    np.zeros()

  3. C.

    np.ones()

  4. D.

    np.null()

Attempted by 211 students.

Show answer & explanation

Correct answer: B

Explore the full course: Bpsc

Loading lesson…