What does the np.vstack() function do in NumPy?
Correct answer
A. Stacks arrays vertically
16 views
A. Stacks arrays vertically
16 views
np.vstack() stacks arrays vertically, i.e. row-wise, one on top of another. Two arrays of shape (3,) become one array of shape (2, 3).
np.hstack() stacks horizontally, column-wise.
Keep preparing with more Data Science MCQs on MCQsExam.com.
Not sure why the answer is A? Ask here and get an explanation.