Converts a flat index or array of flat indices into a tuple of coordinate arrays.
Parameters : | indices : array_like
dims : tuple of ints
order : {‘C’, ‘F’}, optional
|
---|---|
Returns : | unraveled_coords : tuple of ndarray
|
See also
Examples
>>> np.unravel_index([22, 41, 37], (7,6))
(array([3, 6, 6]), array([4, 5, 1]))
>>> np.unravel_index([31, 41, 13], (7,6), order='F')
(array([3, 6, 6]), array([4, 5, 1]))
>>> np.unravel_index(1621, (6,7,8,9))
(3, 1, 4, 1)