Python's numpy has adopted faulty nomenclature. In numpy, ravel() decomposes a multidimensional array into a one-dimensional array. Good choice of name. But, in numpy, unravel_index() recovers the higher dimensional structure of a one-dimensional array. Useful function! but bad choice of name, since in the English language, "unravel" means the same as "ravel." Also, it yields indices (plural) not one index. So, this nomenclature should be useless, returning the given index. Recovering the higher dimensional indices should be named getWeaveIndices(index1D, desired.shape) or getReshapedIndices(index1D, desired.shape) not unravel_index(index1D, desired.shape) -------from https://www.merriam-webster.com/dictionary/ravel---------- ravel: TRANSITIVE VERB a. to separate or undo the texture of: see "unravel" b. to undo the intracies of: see "disentangle" ravel: INTRANSITIVE VERB a. to become unwoven, untwisted, unwound: see "fray" unravel: TRANSITIVE VERB a. to disengage or separate the threads of: see "disentangle" weave: TRANSITIVE VERB a. to form (cloth) by interlacing strands (as of yarn) b: to direct something in a winding or zigzag course