dpnp.column_stack

dpnp.column_stack(tup)[source]

Stacks 1-D and 2-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 dpnp.hstack. 1-D arrays are turned into 2-D columns first.

For full documentation refer to numpy.column_stack.

Parameters:

tup ({dpnp.ndarray, usm_ndarray}) -- A sequence of 1-D or 2-D arrays to stack. All of them must have the same first dimension.

Returns:

out -- The array formed by stacking the given arrays.

Return type:

dpnp.ndarray

See also

dpnp.stack

Join a sequence of arrays along a new axis.

dpnp.dstack

Stack arrays in sequence depth wise (along third axis).

dpnp.hstack

Stack arrays in sequence horizontally (column wise).

dpnp.vstack

Stack arrays in sequence vertically (row wise).

dpnp.concatenate

Join a sequence of arrays along an existing axis.

Examples

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