Array creation routines

From shape or value

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.

From existing data

dpnp.array

Create an array.

dpnp.asarray

Converts an input object into array.

dpnp.asanyarray

Convert the input to an dpnp.ndarray.

dpnp.ascontiguousarray

Return a contiguous array in memory (C order).

dpnp.astype

Copy the array with data type casting.

dpnp.copy

Return an array copy of the given object.

dpnp.frombuffer

Interpret a buffer as a 1-dimensional array.

dpnp.from_dlpack

Create a dpnp array from a Python object implementing the __dlpack__ protocol.

dpnp.fromfile

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

dpnp.fromfunction

Construct an array by executing a function over each coordinate.

dpnp.fromiter

Create a new 1-dimensional array from an iterable object.

dpnp.fromstring

A new 1-D array initialized from text data in a string.

dpnp.loadtxt

Load data from a text 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".

Building matrices

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.

dpnp.vander

Generate a Vandermonde matrix.

The Matrix class