numpy.unravel_index() function | Python Last Updated : 22 Apr, 2020 Comments Improve Suggest changes Like Article Like Report numpy.unravel_index() function converts a flat index or array of flat indices into a tuple of coordinate arrays. Syntax : numpy.unravel_index(indices, shape, order = 'C') Parameters : indices : [array_like] An integer array whose elements are indices into the flattened version of an array of dimensions shape. shape : [tuple of ints] The shape of the array to use for unraveling indices. order : [{āCā, āFā}, optional] Determines whether the multi-index should be viewed as indexing in row-major (C-style) or column-major (Fortran-style) order. Return : [tuple of ndarray] Each array in the tuple has the same shape as the indices array. Code #1 : Python3 # Python program explaining # numpy.unravel_index() function # importing numpy as geek import numpy as geek gfg = geek.unravel_index([22, 41, 37], (7, 6)) print(gfg) Output : (array([3, 6, 6]), array([4, 5, 1])) Code #2 : Python3 # Python program explaining # numpy.unravel_index() function # importing numpy as geek import numpy as geek gfg = geek.unravel_index([22, 41, 37], (7, 6), order = 'F') print(gfg) Output : (array([1, 6, 2]), array([3, 5, 5])) Comment More infoAdvertise with us Next Article numpy.unravel_index() function | Python S sanjoy_62 Follow Improve Article Tags : Machine Learning Python-numpy Python numpy-arrayManipulation python Practice Tags : Machine Learningpython Similar Reads numpy.ravel_multi_index() function | Python numpy.ravel_multi_index() function converts a tuple of index arrays into an array of flat indices, applying boundary modes to the multi-index. Syntax : numpy.ravel_multi_index(multi_index, dims, mode = 'raise', order = 'C) Parameters : multi_index : [tuple of array_like] A tuple of integer arrays, o 2 min read numpy.tril_indices() function | Python numpy.tril_indices() function return the indices for the lower-triangle of an (n, m) array. Syntax : numpy.tril_indices(n, k = 0, m = None) Parameters : n : [int] The row dimension of the arrays for which the returned indices will be valid. k : [int, optional] Diagonal offset. m : [int, optional] Th 1 min read numpy.mask_indices() function | Python numpy.mask_indices() function return the indices to access (n, n) arrays, given a masking function. Syntax : numpy.mask_indices(n, mask_func, k = 0) Parameters : n : [int] The returned indices will be valid to access arrays of shape (n, n). mask_func : [callable] A function whose call signature is s 1 min read numpy.index() in Python numpy.core.defchararray.index(arr, substring, start=0, end=None): Finds the lowest index of the sub-string in the specified range But if substring is not found, it raises ValueError. Parameters: arr : array-like or string to be searched. substring : substring to search for. start, end : [int, option 1 min read numpy.who function - Python numpy.who() function print the NumPy arrays in the given dictionary. Syntax : numpy.who(vardict = None) Parameters : vardict : [dict, optional] A dictionary possibly containing ndarrays. Return : Returns âNoneâ. If there is no dictionary passed in or vardict is None then returns NumPy arrays in the 1 min read Like