You could create broadcast object, and call np.column_stack on that:

In [175]: np.column_stack(np.broadcast([1, 2, 3], 0, [3, 2, 1]))
Out[175]: 
array([[1, 2, 3],
       [0, 0, 0],
       [3, 2, 1]])

Alternatively, you could ask NumPy to literally broadcast the items to compatibly-shaped arrays:

In [158]: np.broadcast_arrays([1, 2, 3], [3, 2, 1], 0)
Out[158]: [array([1, 2, 3]), array([3, 2, 1]), array([0, 0, 0])]

and then call vstack or row_stack on that:

In [176]: np.row_stack(np.broadcast_arrays([1, 2, 3], 0, [3, 2, 1]))
Out[176]: 
array([[1, 2, 3],
       [0, 0, 0],
       [3, 2, 1]])

Of these two options (using np.broadcast or np.broadcast_arrays), np.broadcast is quicker since you don't actually need to instantiate the broadcasted sub-arrays.

One limitation of np.broadcast, however, is that it can accept at most 32 arguments. In that case, use np.broadcast_arrays.

Answer from unutbu on Stack Overflow
🌐
Educative
educative.io › answers › what-is-the-numpyrowstack-function-in-numpy
What is the numpy.row_stack() function in NumPy?
The row_stack() function in NumPy is used to stack or arrange arrays in sequence vertically (row-wise).
🌐
NumPy
numpy.org › doc › 1.25 › reference › generated › numpy.row_stack.html
numpy.row_stack — NumPy v1.25 Manual
This function makes most sense for arrays with up to 3 dimensions. For instance, for pixel-data with a height (first axis), width (second axis), and r/g/b channels (third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations. np.row_stack is an alias for vstack.
🌐
NumPy
numpy.org › doc › 1.21 › reference › generated › numpy.row_stack.html
numpy.row_stack — NumPy v1.21 Manual
June 22, 2021 - Stack 1-D arrays as columns into a 2-D array. ... Split an array into multiple sub-arrays vertically (row-wise).
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-stack-in-python
numpy.stack() in Python - GeeksforGeeks
December 13, 2025 - import numpy as np a = np.array([1, 2, 3]) b = np.array([4, 5, 6]) print(np.stack((a, b), axis=0)) print(np.stack((a, b), axis=1)) print(np.stack((a, b), axis=-1)) Output · [[1 2 3] [4 5 6]] [[1 4] [2 5] [3 6]] [[1 4] [2 5] [3 6]] Explanation: axis=0: a and b become rows.
Find elsewhere
🌐
TutorialsPoint
tutorialspoint.com › numpy › numpy_row_stack_function.htm
Numpy row_stack() Function
The numpy.row_stack() function stacks 1D arrays into rows of a 2D array, resulting in an array with shape (m, n), where m is the number of arrays and n is the length of the arrays.
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.stack.html
numpy.stack — NumPy v2.3 Manual
The stacked array has one more dimension than the input arrays. ... Join a sequence of arrays along an existing axis. ... Assemble an nd-array from nested lists of blocks. ... Split array into a list of multiple sub-arrays of equal size. ... Split an array into a tuple of sub-arrays along an axis. ... Try it in your browser! >>> import numpy as np >>> rng = np.random.default_rng() >>> arrays = [rng.normal(size=(3,4)) for _ in range(10)] >>> np.stack(arrays, axis=0).shape (10, 3, 4)
🌐
Medium
medium.com › nerd-for-tech › stacking-and-splitting-numpy-arrays-like-a-pro-part-1-b04ed83c8442
Stacking and Splitting NumPy arrays like a Pro: Part 1 | by Devansh Sheth | Medium
April 4, 2023 - Numpy’s stack function is used to join multiple numpy arrays along a new axis and return a numpy array. One of the main requirement to keep in mind is that arrays should have same shape and dimension.
🌐
W3Schools
w3schools.com › python › numpy › numpy_array_join.asp
NumPy Joining Array
NumPy provides a helper function: hstack() to stack along rows.
🌐
w3resource
w3resource.com › numpy › manipulation › vstack.php
NumPy: numpy.vstack() function - w3resource
April 24, 2026 - numpy.vstack() is used to vertically stack multiple arrays into a single array. It is commonly used to concatenate arrays row-wise.
🌐
Tutorialsandyou
tutorialsandyou.com › python › numpy-row-stack-in-python-74.html
NumPy Row Stacking | numpy.row_stack() in Python
import numpy as np x = np.array([1, 2, 3, 4]) y = np.array([5, 6, 7, 8]) print('First array x:\n', x) print('Second array y:\n', y) print('Row stacked array:\n', np.row_stack((x,y)))
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › how to use numpy stack() in python
How to Use NumPy stack() in Python - Spark By {Examples}
March 27, 2024 - NumPy stack() function is used to stack or join the sequence of given arrays along a new axis. It generates a single array by taking elements from the
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.stack.html
numpy.stack — NumPy v2.5 Manual
The stacked array has one more dimension than the input arrays. ... Join a sequence of arrays along an existing axis. ... Assemble an nd-array from nested lists of blocks. ... Split array into a list of multiple sub-arrays of equal size. ... Split an array into a tuple of sub-arrays along an axis. ... Try it in your browser! >>> import numpy as np >>> rng = np.random.default_rng() >>> arrays = [rng.normal(size=(3,4)) for _ in range(10)] >>> np.stack(arrays, axis=0).shape (10, 3, 4)
🌐
NumPy
numpy.org › doc › 1.13 › reference › generated › numpy.ma.row_stack.html
numpy.ma.row_stack — NumPy v1.13 Manual
Stack arrays in sequence vertically (row wise). Take a sequence of arrays and stack them vertically to make a single array. Rebuild arrays divided by vsplit. This function continues to be supported for backward compatibility, but you should prefer np.concatenate or np.stack.
🌐
datagy
datagy.io › home › numpy › numpy stack: join numpy arrays along different axes
NumPy Stack: Join NumPy Arrays Along Different Axes • datagy
December 30, 2022 - By default, NumPy stacks the two arrays on the 0th axis. In this case, this means that we’re joining the two arrays in a row-wise manner.
🌐
GeeksforGeeks
geeksforgeeks.org › numpy-vstack-in-python
numpy.vstack() in python - GeeksforGeeks
April 25, 2025 - numpy.vstack() is a function in NumPy used to stack arrays vertically (row-wise).
🌐
Data Science Parichay
datascienceparichay.com › home › blog › using numpy vstack() to vertically stack arrays
Using numpy vstack() to vertically stack arrays - Data Science Parichay
June 17, 2022 - You can use the numpy vstack() function to concatenate numpy arrays vertically. It stacks the arrays in sequence vertically (row-wise).