Array Manipulation Routines

Basic operations

dpnp.copyto

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

dpnp.shape

Return the shape of an array.

Changing array shape

dpnp.reshape

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

dpnp.ravel

Return a contiguous flattened array.

dpnp.ndarray.flat

Return a flat iterator, or set a flattened version of self to value.

dpnp.ndarray.flatten

Return a copy of the array collapsed into one dimension.

Transpose-like operations

dpnp.moveaxis

Move axes of an array to new positions.

dpnp.roll

Roll the elements of an array by a number of positions along a given axis.

dpnp.rollaxis

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

dpnp.swapaxes

Interchange two axes of an array.

dpnp.ndarray.T

View of the transposed array.

dpnp.transpose

Returns an array with axes transposed.

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

Broadcast an array to a new shape.

dpnp.broadcast_arrays

Broadcast any number of arrays against each other.

dpnp.expand_dims

Expand the shape of an array.

dpnp.squeeze

Removes singleton dimensions (axes) from array a.

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 dpnp.ndarray.

dpnp.asfarray

Return an array converted to a float type.

dpnp.asfortranarray

Return an array (ndim >= 1) laid out in Fortran order in memory.

dpnp.ascontiguousarray

Return a contiguous array 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.vstack

Stack arrays in sequence vertically (row wise).

dpnp.hstack

Stack arrays in sequence horizontally (column wise).

dpnp.column_stack

Stacks 1-D and 2-D arrays as columns into a 2-D array.

dpnp.row_stack

Stack arrays in sequence vertically (row wise).

dpnp.dstack

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

Splitting arrays

Tiling arrays

dpnp.tile

Construct an array by repeating A the number of times given by reps.

dpnp.repeat

Repeat elements of an array.

Adding and removing elements

dpnp.unique

Find the unique elements of an array.

Rearranging elements

dpnp.flip

Reverse the order of elements in an array along the given axis.

dpnp.fliplr

Reverse the order of elements along axis 1 (left/right).

dpnp.flipud

Reverse the order of elements along axis 0 (up/down).

dpnp.reshape

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

dpnp.roll

Roll the elements of an array by a number of positions along a given axis.