AI engineering glossary · NumPy pandas visualization

What is np.stack?

np.stack (also called stack, vstack, hstack): Joining arrays of identical shape along a brand-new axis, so the result has one more dimension than the inputs. Variants vstack and hstack join vertically or horizontally. It is used to gather many samples into a single batch array.

Level: intermediateTopic: NumPy pandas visualization

np.stack: an example

Stacking three arrays of shape (4,) with np.stack gives one array of shape (3, 4).

Related terms

More NumPy pandas visualization terms

Where you learn it

np.stack is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.