原文:https://docs.scipy.org/doc/numpy/reference/generated/numpy.unravel_index.html
校对:(虚位以待)
numpy.
unravel_index
(indices, dims, order='C')将平面索引的平面索引或数组转换为坐标数组的元组。
参数: | indices:array_like
dims:ints的tuple
order:{'C','F'},可选
|
---|---|
返回: | unraveled_coords:ndarray的元组
|
也可以看看
例子
>>> 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)