Array Manipulation Routines

The following tables show array manipulation routines provided by NLCPy.

Basic Operations

nlcpy.shape

Returns the shape of an array.

nlcpy.copyto

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

Changing Array Shape

nlcpy.reshape

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

nlcpy.ravel

Returns a contiguous flattened array.

Transpose-like Operations

nlcpy.moveaxis

Moves axes of an array to new positions.

nlcpy.rollaxis

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

nlcpy.transpose

Permutes the dimensions of an array.

Changing Number of Dimensions

nlcpy.broadcast_to

Broadcasts an array to a new shape.

nlcpy.expand_dims

Expands the shape of an array.

nlcpy.squeeze

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

Joining Arrays

nlcpy.concatenate

Joins a sequence of arrays along an existing axis.

nlcpy.hstack

Stacks arrays in sequence horizontally (column wise).

nlcpy.stack

Joins a sequence of arrays along a new axis.

nlcpy.vstack

Stacks arrays in sequence vertically (row wise).

Tiling Arrays

nlcpy.tile

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

nlcpy.repeat

Repeats elements of an array.

Adding and Removing Elements

nlcpy.append

Appends values to the end of an array.

nlcpy.delete

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

nlcpy.insert

Inserts values along the given axis before the given indices.

nlcpy.resize

Returns a new array with the specified shape.

Rearranging Elements

nlcpy.flip

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

nlcpy.fliplr

Flips array in the left/right direction.

nlcpy.flipud

Flips array in the up/down direction.