COO.linear_loc
- COO.linear_loc()[source]
The nonzero coordinates of a flattened version of this array. Note that the coordinates may be out of order.
- Returns:
The flattened coordinates.
- Return type:
See also
numpy.flatnonzero
Equivalent Numpy function.
Examples
>>> x = np.eye(5) >>> s = COO.from_numpy(x) >>> s.linear_loc() array([ 0, 6, 12, 18, 24]) >>> np.array_equal(np.flatnonzero(x), s.linear_loc()) True