Manipulation Functions

Array API specification for manipulating arrays.

A conforming implementation of the array API standard must provide and support the following functions.

Objects in API


Broadcasts one or more arrays against one another.

broadcast_to(x, /, shape)

Broadcasts an array to a specified shape.

concat(arrays, /, *, axis=0)

Joins a sequence of arrays along an existing axis.

expand_dims(x, /, *, axis=0)

Expands the shape of an array by inserting a new axis (dimension) of size one at the position specified by axis.

flip(x, /, *, axis=None)

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

moveaxis(x, source, destination, /)

Moves array axes (dimensions) to new positions, while leaving other axes in their original positions.

permute_dims(x, /, axes)

Permutes the axes (dimensions) of an array x.

repeat(x, repeats, /, *, axis=None)

Repeats each element of an array a specified number of times on a per-element basis.

reshape(x, /, shape, *, copy=None)

Reshapes an array without changing its data.

roll(x, /, shift, *, axis=None)

Rolls array elements along a specified axis.

squeeze(x, /, axis)

Removes singleton dimensions (axes) from x.

stack(arrays, /, *, axis=0)

Joins a sequence of arrays along a new axis.

tile(x, repetitions, /)

Constructs an array by tiling an input array.

unstack(x, /, *, axis=0)

Splits an array in a sequence of arrays along the given axis.