You could try putting all your arrays (or lists) into a matrix and then transposing it. This will work if all arrays are the same length.

mymatrix = np.asmatrix((array1, array2, array3)) #... putting arrays into matrix.
mymatrix = mymatrix.transpose()

This should output a matrix with each array as a column. Hope this helps.

Answer from Tane on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ numpy-column_stack-in-python
numpy.column_stack() in Python - GeeksforGeeks
January 6, 2019 - numpy.column_stack() function is used to stack 1-D arrays as columns into a 2-D array.It takes a sequence of 1-D arrays and stack them as columns to make a single 2-D array.
Discussions

python - Numpy: How to stack arrays in columns? - Stack Overflow
Let's say that I have n numpy arrays of the same length. I would like to now create a numpy matrix, sucht that each column of the matrix is one of the numpy arrays. How can I achieve this? Now I'm ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - numpy vstack vs. column_stack - Stack Overflow
What exactly is the difference between numpy vstack and column_stack. Reading through the documentation, it looks as if column_stack is an implementation of vstack for 1D arrays. Is it a more effic... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Someone please help me, I'm about to give up [np.column_stack()]
I am not sure what the issue is? What does the instructor's output look like? Looking at the source documentation np.column_stack is doing what it should. An example input: x = np.array((3,4,5)) y = np.array((7,8,9)) np.column_stack((x,y)) Output: array([[3, 7], [4, 8], [5, 9]]) The 1D arrays are stacked as columns into a 2D array. More on reddit.com
๐ŸŒ r/learnpython
8
0
July 31, 2022
python - Inconsistent functionality of numpy columnstack/hstack - Stack Overflow
I would like to column stack those sets of data if they are of the same length. ... import numpy as np def retrieve_XY(file_path): # XY data is read in from a file in text format file_data = open(file_path).readlines() # The list of strings (lines in the file) is made into a list of lists while ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ numpy โ€บ numpy_column_stack_function.htm
Numpy column_stack() Function
The numpy.column_stack() function stacks 1D arrays into columns of a 2D array, resulting in an array with shape (n, m), where n is the length of the arrays and m is the number of arrays.
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ what-is-the-numpycolumnstack-function-in-numpy
What is the numpy.column_stack() function in NumPy?
The column_stack() function in NumPy is used to stack or arrange 1-D input arrays as columns into a 2-D array.
Top answer
1 of 3
2

You could try putting all your arrays (or lists) into a matrix and then transposing it. This will work if all arrays are the same length.

mymatrix = np.asmatrix((array1, array2, array3)) #... putting arrays into matrix.
mymatrix = mymatrix.transpose()

This should output a matrix with each array as a column. Hope this helps.

2 of 3
1

Time and again, we recommend collecting the arrays in a list, and making the final array with one call. That's more efficient, and usually easier to get right.

alist = []
for item in sorted_arrays:
    alist.append(get_array(item)

or

alist = [get_array(item) for item in sorted_arrays]

There are various ways of assembling the list. Since you want columns, and assuming get_array produces equal sized 1d arrays:

arr = np.column_stack(alist)

Collecting them in rows and transposing that works too:

arr = np.array(alist).T
arr = np.vstack(alist).T
arr = np.stack(alist).T
arr = np.stack(alist, axis=1)

If the arrays are already 2d

arr = np.concatenate(alist, axis=1)

All the stack variations use concatenate, just varying in how they tweak the shape(s) of the input arrays. The key to using concatenate is to understand the dimensions and shapes, and how to add dimensions as needed. That should, soon or later, become fluent in that kind of coding.

If they vary in shape or dimensions, things get messier.

Equally good is to put the arrays in a pre-allocated array. But you need to know the desired final shape

arr = np.zeros((m,n), dtype)
for i, item in enumerate(sorted_arrays):
    arr[:,i] = get_array(item)

n is len(sorted_arrays), and m is the length of one of get_array(item). You also need to know the expected dtype (int, float etc).

Find elsewhere
๐ŸŒ
JAX Documentation
docs.jax.dev โ€บ en โ€บ latest โ€บ _autosummary โ€บ jax.numpy.column_stack.html
jax.numpy.column_stack โ€” JAX documentation
For arrays of two or more dimensions, this is equivalent to jax.numpy.concatenate() with axis=1. ... tup (np.ndarray | Array | Sequence[ArrayLike]) โ€“ a sequence of arrays to stack; each must have the same leading dimension. Input arrays will be promoted to at least rank 2. If a single array is given it will be treated equivalently to tup = unstack(tup), but the implementation will avoid explicit unstacking. ... >>> x = jnp.arange(3) >>> y = jnp.ones(3) >>> jnp.column_stack([x, y]) Array([[0., 1.], [1., 1.], [2., 1.]], dtype=float32)
๐ŸŒ
Medium
medium.com โ€บ data-science โ€บ np-stack-how-to-stack-two-arrays-in-numpy-and-python-fc910dd2d57a
np.stack() โ€” How To Stack two Arrays in Numpy And Python | by Dario Radeฤiฤ‡ | TDS Archive | Medium
January 11, 2023 - Today youโ€™ll learn all about np stack โ€” or the Numpyโ€™s stack() function. Put simply, it allows you to join arrays row-wise (default) or column-wise, depending on the parameter values you specify.
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ someone please help me, i'm about to give up [np.column_stack()]
r/learnpython on Reddit: Someone please help me, I'm about to give up [np.column_stack()]
July 31, 2022 -

I am doing a course on python for data science and I'm supposed to stack two columns from the dataframe using np.column_stack().

The problem is, individually the two different columns are printing the way I want them, but whenever i stack them it does some weird thing..

happy = data['happyScore']

income = data['avg_income']

print(happy.head(), income.head())

output:

0 4.350

1 4.033

2 6.574

3 7.200

4 7.284

Name: happyScore, dtype: float64

0 2096.76

1 1448.88

2 7101.12

3 19457.04

4 19917.00

Name: avg_income, dtype: float64

So these two individually are printing like I want them.

income_happy = np.column_stack((income, happy))

print(income_happy)

output:

[[2.09676000e+03 4.35000000e+00]

[1.44888000e+03 4.03300000e+00]

[7.10112000e+03 6.57400000e+00]

[1.94570400e+04 7.20000000e+00]

and so on..

What is happening because the instructor did the same thing as I did and his came out with the original values just stacked normally.

๐ŸŒ
IncludeHelp
includehelp.com โ€บ python โ€บ numpy-vstack-vs-column_stack.aspx
Python - NumPy vstack vs. column_stack
When we use column_stack() to append a column we want, we need to convert it from a 1-dimensional array to a 2-dimensional column because a 1d array is normally interpreted as a vector-row in a 2d context in NumPy.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ stable โ€บ reference โ€บ generated โ€บ numpy.hstack.html
numpy.hstack โ€” NumPy v2.5 Manual
Stack 1-D arrays as columns into a 2-D array. ... Split an array into multiple sub-arrays horizontally (column-wise). ... Split an array into a tuple of sub-arrays along an axis. ... Try it in your browser! >>> import numpy as np >>> a = np.array((1,2,3)) >>> b = np.array((4,5,6)) >>> ...
๐ŸŒ
w3resource
w3resource.com โ€บ numpy โ€บ manipulation โ€บ column-stack.php
NumPy: numpy.column_stack() function - w3resource
April 24, 2026 - This function is useful when we ... array's columns. The numpy.column_stack() function takes a sequence of 1-D or 2-D arrays and stacks them as columns into a 2-D array....
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ 2.3 โ€บ reference โ€บ generated โ€บ numpy.hstack.html
numpy.hstack โ€” NumPy v2.3 Manual
Stack 1-D arrays as columns into a 2-D array. ... Split an array into multiple sub-arrays horizontally (column-wise). ... Split an array into a tuple of sub-arrays along an axis. ... Try it in your browser! >>> import numpy as np >>> a = np.array((1,2,3)) >>> b = np.array((4,5,6)) >>> ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-ways-to-add-row-columns-in-numpy-array
Ways to Add Row/Columns in Numpy Array - Python - GeeksforGeeks
June 24, 2025 - Explanation: np.column_stack((a, b)) stacks b as a new column to the right of a. To add rows to a NumPy array, use functions like np.r_, np.insert(), np.vstack() or np.append() with axis=0.