Which NumPy function creates an array of zeros?
-
A
np.empty()
-
B
np.zeros()
Correct answer
-
C
np.ones()
-
D
np.array()
Correct answer
B. np.zeros()
18 views
Explanation
np.zeros() creates a new array filled with zeros of specified shape and dtype.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ