Array Manipulation Routines

Basic operations

dpnp.copyto

Copies values from one array to another, broadcasting as necessary.

Changing array shape

dpnp.reshape

Gives a new shape to an array without changing its data.

dpnp.ravel

Return a contiguous flattened array.

Transpose-like operations

dpnp.moveaxis

Move axes of an array to new positions.

dpnp.rollaxis

Roll the specified axis backwards, until it lies in a given position.

dpnp.swapaxes

Interchange two axes of an array.

dpnp.transpose

Reverse or permute the axes of an array; returns the modified array.

See also

dpnp.dparray.T

Changing number of dimensions

dpnp.atleast_1d

Convert inputs to arrays with at least one dimension.

dpnp.atleast_2d

View inputs as arrays with at least two dimensions.

dpnp.atleast_3d

View inputs as arrays with at least three dimensions.

dpnp.expand_dims

Expand the shape of an array.

dpnp.squeeze

Remove single-dimensional entries from the shape of an array.

Changing kind of array

dpnp.asarray

Converts an input object into array.

dpnp.asnumpy

Returns the NumPy array with input data.

dpnp.asanyarray

Convert the input to an ndarray, but pass ndarray subclasses through.

dpnp.asfarray

Return an array converted to a float type.

dpnp.ascontiguousarray

Return a contiguous array (ndim >= 1) in memory (C order).

Joining arrays

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.vstack

Stack arrays in sequence vertically (row wise).

Splitting arrays

Tiling arrays

dpnp.repeat

Repeat elements of an array.

Adding and removing elements

dpnp.unique

Find the unique elements of an array.

Rearranging elements

dpnp.reshape

Gives a new shape to an array without changing its data.