nums.numpy.column_stack
-
nums.numpy.
column_stack
(tup)[source] Stack 1-D arrays as columns into a 2-D array.
This docstring was copied from numpy.column_stack.
Some inconsistencies with the NumS version may exist.
Take a sequence of 1-D arrays and stack them as columns to make a single 2-D array. 2-D arrays are stacked as-is, just like with hstack. 1-D arrays are turned into 2-D columns first.
- Parameters
tup (sequence of 1-D or 2-D arrays.) – Arrays to stack. All of them must have the same first dimension.
- Returns
stacked – The array formed by stacking the given arrays.
- Return type
2-D array
See also
stack
,hstack
,vstack
,concatenate
Examples
The doctests shown below are copied from NumPy. They won’t show the correct result until you operate
get()
.>>> a = nps.array((1,2,3)) >>> b = nps.array((2,3,4)) >>> nps.column_stack((a,b)).get() array([[1, 2], [2, 3], [3, 4]])