COO.sort_indices¶
-
COO.
sort_indices
()[source]¶ Sorts the
COO.coords
attribute. Also sorts the data inCOO.data
to match.Examples
>>> coords = np.array([[1, 2, 0]], dtype=np.uint8) >>> data = np.array([4, 1, 3], dtype=np.uint8) >>> s = COO(coords, data) >>> s.sort_indices() >>> s.coords array([[0, 1, 2]], dtype=uint8) >>> s.data array([3, 4, 1], dtype=uint8)