Array manipulation routines

Basic operations

dpnp.copyto

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

dpnp.ndim

Return the number of dimensions of array-like input.

dpnp.shape

Return the shape of an array.

dpnp.size

Return the number of elements along a given axis.

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

dpnp.permute_dims

Returns an array with axes transposed.

dpnp.matrix_transpose

Transposes a matrix (or a stack of matrices) x.

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

Convert the input to an dpnp.ndarray.

dpnp.asnumpy

Returns the NumPy array with input data.

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 (ndim >= 1) in memory (C order).

dpnp.asarray_chkfinite

Convert the input to an array, checking for NaNs or Infs.

dpnp.require

Return a dpnp.ndarray of the provided type that satisfies requirements.

Joining arrays

dpnp.concatenate

Join a sequence of arrays along an existing axis.

dpnp.concat

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

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

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

Splitting arrays

dpnp.split

Split an array into multiple sub-arrays as views into ary.

dpnp.array_split

Split an array into multiple sub-arrays.

dpnp.dsplit

Split array into multiple sub-arrays along the 3rd axis (depth).

dpnp.hsplit

Split an array into multiple sub-arrays horizontally (column-wise).

dpnp.vsplit

Split an array into multiple sub-arrays vertically (row-wise).

dpnp.unstack

Split an array into a sequence of arrays along the given axis.

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

Return a new array with sub-arrays along an axis deleted.

dpnp.insert

Insert values along the given axis before the given indices.

dpnp.append

Append values to the end of an array.

dpnp.resize

Return a new array with the specified shape.

dpnp.trim_zeros

Remove values along a dimension which are zero along all other.

dpnp.unique

Find the unique elements of an array.

dpnp.pad

Pad 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.roll

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

dpnp.rot90

Rotate an array by 90 degrees in the plane specified by axes.