outer¶
-
sparse.
outer
(a, b, out=None)[source]¶ Return outer product of two sparse arrays.
- Parameters
a (sparse.SparseArray) – The input arrays.
b (sparse.SparseArray) – The input arrays.
out (sparse.SparseArray) – The output array.
Examples
>>> import numpy as np >>> import sparse >>> a = sparse.COO(np.arange(4)) >>> o = sparse.outer(a, a) >>> o.todense() array([[0, 0, 0, 0], [0, 1, 2, 3], [0, 2, 4, 6], [0, 3, 6, 9]])