API

Description

Classes

COO(coords[, data, shape, has_duplicates, ...])

A sparse multidimensional array.

DOK(shape[, data, dtype, fill_value])

A class for building sparse multidimensional arrays.

GCXS(arg[, shape, compressed_axes, prune, ...])

A sparse multidimensional array.

SparseArray(shape[, fill_value])

An abstract base class for all the sparse array classes.

Functions

abs(x, /)

all(x, /, *[, axis, keepdims])

any(x, /, *[, axis, keepdims])

argmax(x, /, *[, axis, keepdims])

Returns the indices of the maximum values along a specified axis.

argmin(x, /, *[, axis, keepdims])

Returns the indices of the minimum values along a specified axis.

argwhere(a)

Find the indices of array elements that are non-zero, grouped by element.

asCOO(x[, name, check])

Convert the input to COO.

as_coo(x[, shape, fill_value, idx_dtype])

Converts any given format to COO.

asarray(obj, /, *[, dtype, format, backend, ...])

Convert the input to a sparse array.

asnumpy(a[, dtype, order])

Returns a dense numpy array from an arbitrary source array.

astype(x, dtype, /, *[, copy])

broadcast_arrays(*arrays)

broadcast_to(*args, **kwargs)

clip(a[, a_min, a_max, out])

Clip (limit) the values in the array.

concat(arrays[, axis, compressed_axes])

Concatenate the input arrays along the given dimension.

concatenate(arrays[, axis, compressed_axes])

Concatenate the input arrays along the given dimension.

diagonal(a[, offset, axis1, axis2])

Extract diagonal from a COO array.

diagonalize(a[, axis])

Diagonalize a COO array.

dot(a, b)

Perform the equivalent of numpy.dot on two arrays.

einsum(*operands, **kwargs)

Perform the equivalent of numpy.einsum.

elemwise(func, *args, **kwargs)

Apply a function to any number of arguments.

empty(shape[, dtype, format])

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

empty_like(a[, dtype, shape, format])

Return a SparseArray of zeros with the same shape and type as a.

equal(x1, x2, /)

eye(N[, M, k, dtype, format])

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

full(shape, fill_value[, dtype, format, order])

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

full_like(a, fill_value[, dtype, shape, format])

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

isfinite(x, /)

isinf(*args, **kwargs)

isnan(*args, **kwargs)

isneginf(x[, out])

Test element-wise for negative infinity, return result as sparse bool array.

isposinf(x[, out])

Test element-wise for positive infinity, return result as sparse bool array.

kron(a, b)

Kronecker product of 2 sparse arrays.

load_npz(filename)

Load a sparse matrix in numpy's .npz format from disk.

matmul(a, b)

Perform the equivalent of numpy.matmul on two arrays.

max(x, /, *[, axis, keepdims])

mean(x, /, *[, axis, keepdims, dtype])

min(x, /, *[, axis, keepdims])

moveaxis(a, source, destination)

Move axes of an array to new positions.

moveaxis(a, source, destination)

Move axes of an array to new positions.

nanmax(x[, axis, keepdims, dtype, out])

Maximize along the given axes, skipping NaN values.

nanmean(x[, axis, keepdims, dtype, out])

Performs a NaN skipping mean operation along the given axes.

nanmin(x[, axis, keepdims, dtype, out])

Minimize along the given axes, skipping NaN values.

nanprod(x[, axis, keepdims, dtype, out])

Performs a product operation along the given axes, skipping NaN values.

nanreduce(x, method[, identity, axis, keepdims])

Performs an NaN skipping reduction on this array.

nansum(x[, axis, keepdims, dtype, out])

Performs a NaN skipping sum operation along the given axes.

nonzero(x, /)

ones(shape[, dtype, format])

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

ones_like(a[, dtype, shape, format])

Return a SparseArray of ones with the same shape and type as a.

outer(a, b[, out])

Return outer product of two sparse arrays.

pad(array, pad_width[, mode])

Performs the equivalent of numpy.pad for SparseArray.

permute_dims(x, /[, axes])

prod(x, /, *[, axis, dtype, keepdims])

random(shape[, density, nnz, random_state, ...])

Generate a random sparse multidimensional array

reshape(x, /, shape, *[, copy])

result_type(*arrays_and_dtypes)

Returns the type that results from applying the NumPy type promotion rules to the arguments.

roll(a, shift[, axis])

Shifts elements of an array along specified axis.

round(*args, **kwargs)

save_npz(filename, matrix[, compressed])

Save a sparse matrix to disk in numpy's .npz format.

squeeze(*args, **kwargs)

stack(arrays[, axis, compressed_axes])

Stack the input arrays along the given dimension.

std(x, /, *[, axis, correction, keepdims])

sum(x, /, *[, axis, dtype, keepdims])

tensordot(a, b[, axes, return_type])

Perform the equivalent of numpy.tensordot.

tril(x[, k])

Returns an array with all elements above the k-th diagonal set to zero.

triu(x[, k])

Returns an array with all elements below the k-th diagonal set to zero.

unique_counts(x, /)

Returns the unique elements of an input array x, and the corresponding counts for each unique element in x.

unique_values(x, /)

Returns the unique elements of an input array x.

where(condition[, x, y])

Select values from either x or y depending on condition.

zeros(shape[, dtype, format])

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

zeros_like(a[, dtype, shape, format])

Return a SparseArray of zeros with the same shape and type as a.