dpnp.row_stack

dpnp.row_stack(tup, *, dtype=None, casting='same_kind')

Stack arrays in sequence vertically (row wise).

dpnp.row_stack is an alias for dpnp.vstack. They are the same function.

For full documentation refer to numpy.vstack.

Parameters:
  • tup ({dpnp.ndarray, usm_ndarray}) -- The arrays must have the same shape along all but the first axis. 1-D arrays must have the same length.

  • dtype (str or dtype) -- If provided, the destination array will have this dtype.

  • casting ({'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional) -- Controls what kind of data casting may occur. Defaults to 'same_kind'.

Returns:

out -- The array formed by stacking the given arrays, will be at least 2-D.

Return type:

dpnp.ndarray

See also

dpnp.concatenate

Join a sequence of arrays along an existing axis.

dpnp.stack

Join a sequence of arrays along a new axis.

dpnp.hstack

Stack arrays in sequence horizontally (column wise).

dpnp.dstack

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

dpnp.column_stack

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

dpnp.block

Assemble an ndarray from nested lists of blocks.

dpnp.split

Split array into a list of multiple sub-arrays of equal size.

dpnp.unstack

Split an array into a tuple of sub-arrays along an axis.

Examples

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