dpnp
dpnp copied to clipboard
Array creation routines
Need to implement following functions as described here Array creation routines
Ones and zeros
- [x] empty(shape[, dtype, order]) Return a new array of given shape and type, without initializing entries.
- [x] empty_like(prototype[, dtype, order, subok, …]) Return a new array with the same shape and type as a given array.
- [x] eye(N[, M, k, dtype, order]) Return a 2-D array with ones on the diagonal and zeros elsewhere.
- [x] identity(n[, dtype]) Return the identity array.
- [x] ones(shape[, dtype, order]) Return a new array of given shape and type, filled with ones.
- [x] ones_like(a[, dtype, order, subok, shape]) Return an array of ones with the same shape and type as a given array.
- [x] zeros(shape[, dtype, order]) Return a new array of given shape and type, filled with zeros.
- [x] zeros_like(a[, dtype, order, subok, shape]) Return an array of zeros with the same shape and type as a given array.
- [x] full(shape, fill_value[, dtype, order]) Return a new array of given shape and type, filled with fill_value.
- [x] full_like(a, fill_value[, dtype, order, …]) Return a full array with the same shape and type as a given array.
From existing data
- [x] array(object[, dtype, copy, order, subok, ndmin]) Create an array.
- [x] asarray(a[, dtype, order]) Convert the input to an array.
- [x] asanyarray(a[, dtype, order]) Convert the input to an ndarray, but pass ndarray subclasses through.
- [x] ascontiguousarray(a[, dtype]) Return a contiguous array (ndim >= 1) in memory (C order).
- [ ] asmatrix(data[, dtype]) Interpret the input as a matrix.
- [x] copy(a[, order, subok]) Return an array copy of the given object.
- [x] frombuffer(buffer[, dtype, count, offset]) Interpret a buffer as a 1-dimensional array.
- [x] fromfile(file[, dtype, count, sep, offset]) Construct an array from data in a text or binary file.
- [ ] fromfunction(function, shape, *[, dtype]) Construct an array by executing a function over each coordinate.
- [x] fromiter(iterable, dtype[, count]) Create a new 1-dimensional array from an iterable object.
- [ ] fromstring(string[, dtype, count, sep]) A new 1-D array initialized from text data in a string.
- [ ] loadtxt(fname[, dtype, comments, delimiter, …]) Load data from a text file.
Creating record arrays (numpy.rec)
- [ ] core.records.array(obj[, dtype, shape, …]) Construct a record array from a wide-variety of objects.
- [ ] core.records.fromarrays(arrayList[, dtype, …]) Create a record array from a (flat) list of arrays
- [ ] core.records.fromrecords(recList[, dtype, …]) Create a recarray from a list of records in text form.
- [ ] core.records.fromstring(datastring[, dtype, …]) Create a record array from binary data
- [ ] core.records.fromfile(fd[, dtype, shape, …]) Create an array from binary file data
Creating character arrays (numpy.char)
- [ ] core.defchararray.array(obj[, itemsize, …]) Create a chararray.
- [ ] core.defchararray.asarray(obj[, itemsize, …]) Convert the input to a chararray, copying the data only if necessary.
Numerical ranges
- [x] arange([start,] stop[, step,][, dtype]) Return evenly spaced values within a given interval.
- [x] linspace(start, stop[, num, endpoint, …]) Return evenly spaced numbers over a specified interval.
- [x] logspace(start, stop[, num, endpoint, base, …]) Return numbers spaced evenly on a log scale.
- [x] geomspace(start, stop[, num, endpoint, …]) Return numbers spaced evenly on a log scale (a geometric progression).
- [x] meshgrid(*xi[, copy, sparse, indexing]) Return coordinate matrices from coordinate vectors.
- [ ] mgrid nd_grid instance which returns a dense multi-dimensional “meshgrid”.
- [ ] ogrid nd_grid instance which returns an open multi-dimensional “meshgrid”.
Building matrices
- [x] diag(v[, k]) Extract a diagonal or construct a diagonal array.
- [x] diagflat(v[, k]) Create a two-dimensional array with the flattened input as a diagonal.
- [x] tri(N[, M, k, dtype]) An array with ones at and below the given diagonal and zeros elsewhere.
- [x] tril(m[, k]) Lower triangle of an array.
- [x] triu(m[, k]) Upper triangle of an array.
- [x] vander(x[, N, increasing]) Generate a Vandermonde matrix.
The Matrix class
- [ ] mat(data[, dtype]) Interpret the input as a matrix.
- [ ] bmat(obj[, ldict, gdict]) Build a matrix object from a string, nested sequence, or array.