WeCodeAcademy

Joining and Splitting Arrays

np.concatenate joins arrays end to end, np.vstack stacks them as rows and np.hstack places them side by side. np.split cuts an array into equal parts.

Examplepython
Open in editor »
Quick check

What does `np.vstack([a, b])` do for two 1D arrays?

Your turn: write the code

Stack a, b and c as three rows and print the result.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.