From shape or value
(shape[, dtype, order, device, like])
Return a new array of given shape and type, without initializing entries.
(prototype, /[, dtype, order, ...])
Return a new array with the same shape and type as a given array.
(N[, M, k, dtype, order, device, like])
Return a 2-D array with ones on the diagonal and zeros elsewhere.
(n[, dtype, like])
Return the identity array.
(shape[, dtype, order, device, like])
Return a new array of given shape and type, filled with ones.
(a[, dtype, order, subok, shape, ...])
Return an array of ones with the same shape and type as a given array.
(shape[, dtype, order, device, like])
Return a new array of given shape and type, filled with zeros.
(a[, dtype, order, subok, shape, ...])
Return an array of zeros with the same shape and type as a given array.
(shape, fill_value[, dtype, order, ...])
Return a new array of given shape and type, filled with fill_value.
(a, fill_value[, dtype, order, ...])
Return a full array with the same shape and type as a given array.
From existing data
(object[, dtype, copy, order, subok, ...])
Create an array.
(a[, dtype, order, device, copy, like])
Convert the input to an array.
(a[, dtype, order, device, copy, like])
Convert the input to an ndarray, but pass ndarray subclasses through.
(a[, dtype, like])
Return a contiguous array (ndim >= 1) in memory (C order).
(data[, dtype])
Interpret the input as a matrix.
(x, dtype, /, *[, copy, device])
Copies an array to a specified data type.
(a[, order, subok])
Return an array copy of the given object.
(buffer[, dtype, count, offset, like])
Interpret a buffer as a 1-dimensional array.
(x, /, *[, device, copy])
Create a NumPy array from an object implementing the __dlpack__ protocol.
(file[, dtype, count, sep, offset, like])
Construct an array from data in a text or binary file.
(function, shape, *[, dtype, like])
Construct an array by executing a function over each coordinate.
(iter, dtype[, count, like])
Create a new 1-dimensional array from an iterable object.
(string[, dtype, count, like])
A new 1-D array initialized from text data in a string.
(fname[, dtype, comments, delimiter, ...])
Load data from a text file.
Creating record arrays
Creating character arrays (
)
Note
is used to create character arrays.
Numerical ranges
([start,] stop[, step,][, dtype, ...])
Return evenly spaced values within a given interval.
(start, stop[, num, endpoint, ...])
Return evenly spaced numbers over a specified interval.
(start, stop[, num, endpoint, base, ...])
Return numbers spaced evenly on a log scale.
(start, stop[, num, endpoint, ...])
Return numbers spaced evenly on a log scale (a geometric progression).
(*xi[, copy, sparse, indexing])
Return a tuple of coordinate matrices from coordinate vectors.
An instance which returns a dense multi-dimensional "meshgrid".
An instance which returns an open multi-dimensional "meshgrid".
Building matrices
(v[, k])
Extract a diagonal or construct a diagonal array.
(v[, k])
Create a two-dimensional array with the flattened input as a diagonal.
(N[, M, k, dtype, like])
An array with ones at and below the given diagonal and zeros elsewhere.
(m[, k])
Lower triangle of an array.
(m[, k])
Upper triangle of an array.
(x[, N, increasing])
Generate a Vandermonde matrix.
The matrix class