numpy.ma.column_stack

numpy.ma.column_stack(*args, **kwargs) = <numpy.ma.extras._fromnxfunction_seq object>

Stack 1-D arrays as columns into a 2-D array.

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
tupsequence of 1-D or 2-D arrays.

Arrays to stack. All of them must have the same first dimension.

Returns
stacked2-D array

The array formed by stacking the given arrays.

Notes

The function is applied to both the _data and the _mask, if any.

Examples

>>> a = np.array((1,2,3))
>>> b = np.array((2,3,4))
>>> np.column_stack((a,b))
array([[1, 2],
       [2, 3],
       [3, 4]])

© 2005–2020 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.19/reference/generated/numpy.ma.column_stack.html