Array Creation Routines

Basic creation routines

dpnp.empty

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

dpnp.empty_like

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

dpnp.eye

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

dpnp.identity

Return the identity array.

dpnp.ones

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

dpnp.ones_like

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

dpnp.zeros

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

dpnp.zeros_like

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

dpnp.full

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

dpnp.full_like

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

dpnp.vander

Generate a Vandermonde matrix.

Creation from other data

dpnp.array

Creates an array.

dpnp.asarray

Converts an input object into array.

dpnp.asanyarray

Convert the input to an ndarray, but pass ndarray subclasses through.

dpnp.ascontiguousarray

Return a contiguous array (ndim >= 1) in memory (C order).

dpnp.copy

Return an array copy of the given object.

dpnp.fromfile

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

Numerical ranges

dpnp.arange

Returns an array with evenly spaced values within a given interval.

dpnp.linspace

Return evenly spaced numbers over a specified interval.

dpnp.logspace

Return numbers spaced evenly on a log scale.

dpnp.geomspace

Return numbers spaced evenly on a log scale (a geometric progression).

dpnp.meshgrid

Return coordinate matrices from coordinate vectors.

dpnp.mgrid

Construct a dense multi-dimensional "meshgrid".

dpnp.ogrid

Construct an open multi-dimensional "meshgrid".

Matrix creation

dpnp.diag

Extract a diagonal or construct a diagonal array.

dpnp.diagflat

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

dpnp.tri

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

dpnp.tril

Lower triangle of an array.

dpnp.triu

Upper triangle of an array.