Array Creation Routines

The following tables show array creation routines provided by NLCPy.

Ones and Zeros

nlcpy.empty

Returns a new array of given shape and type, without initializing entries.

nlcpy.empty_like

Returns a new array with the same shape and type as a given array.

nlcpy.eye

Returns a 2-D array with ones on the diagonal and zeros elsewhere.

nlcpy.identity

Returns the identity array.The identity array is a square array with ones on the main diagonal.

nlcpy.ones

Returns a new array of given shape and type, filled with ones.

nlcpy.ones_like

Returns an array of ones with the same shape and type as a given array.

nlcpy.zeros

Returns a new array of given shape and type, filled with zeros.

nlcpy.zeros_like

Returns an array of zeros with the same shape and type as a given array.

nlcpy.full

Returns a new array of given shape and type, filled with fill_value.

nlcpy.full_like

Returns a full array with the same shape and type as a given array.

From Existing Data

nlcpy.array

Creates an array.

nlcpy.asarray

Converts the input to an array.

nlcpy.asanyarray

Converts the input to an array, but passes ndarray subclasses through.

nlcpy.copy

Returns an array copy of the given object.

nlcpy.fromfile

Constructs an array from data in a text or binary file.

nlcpy.loadtxt

Loads data from a text file.

Numerical Ranges

nlcpy.arange

Returns evenly spaced values within a given interval.

nlcpy.linspace

Returns evenly spaced numbers over a specified interval.

nlcpy.logspace

Returns numbers spaced evenly on a log scale.

nlcpy.meshgrid

Returns coordinate matrices from coordinate vectors.

Building Matrices

nlcpy.diag

Extracts a diagonal or constructs a diagonal array.

nlcpy.diagflat

Creates a two-dimensional array with the flattened input as a diagonal.

nlcpy.tri

An array with ones at and below the given diagonal and zeros elsewhere.

nlcpy.tril

Lower triangle of an array.

nlcpy.triu

Upper triangle of an array.