numpy.find() in Python Last Updated : 28 Nov, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report numpy.core.defchararray.find(arr, substring, start=0, end=None): Finds the lowest index of the sub-string in the specified range. Parameters: arr : array-like or string to be searched. substring : substring to search for. start, end : [int, optional] Range to search in. Returns : An integer array with the lowest index of found sub-string. Code #1: Python3 1== # Python Program illustrating # numpy.char.find() method import numpy as np arr = ['vdsdsttetteteAAAa', 'AAAAAAAaattttds', 'AAaaxxxxtt', 'AAaaXDSDdscz'] print ("arr : ", arr) print ("\nfind of 'tt'", np.char.find(arr, 'tt')) print ("find of 'tt'", np.char.find(arr, 'tt', start = 0)) print ("find of 'tt'", np.char.find(arr, 'tt', start = 8)) Output: arr : ['vdsdsttetteteAAAa', 'AAAAAAAaattttds', 'AAaaxxxxtt', 'AAaaXDSDdscz'] find of 'tt' [ 5 9 8 -1] find of 'tt' [ 5 9 8 -1] find of 'tt' [ 8 9 8 -1] Code #2: Python3 1== # Python Program illustrating # numpy.char.find() method import numpy as np arr = ['vdsdsttetteteAAAa', 'AAAAAAAaattttds', 'AAaaxxxxtt', 'AAaaXDSDdscz'] print ("\nfind of 'Aa'", np.char.find(arr, 'Aa')) print ("find of 'Aa'", np.char.find(arr, 'Aa', start = 8)) Output: find of 'Aa' [15 6 1 1] find of 'Aa' [15 -1 -1 -1] Comment More infoAdvertise with us Next Article numpy.find() in Python M mohit gupta_omg :) Follow Improve Article Tags : Python Python-numpy Python numpy-String Operation Practice Tags : python Similar Reads 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.where() in Python We will explore the basics of numpy.where(), how it works, and practical use cases to illustrate its importance in data manipulation and analysis.Syntax of numpy.where()Syntax :numpy.where(condition[, x, y]) Parameters condition: A condition that tests elements of the array.x (optional): Values from 3 min read Python | Numpy ndarray.item() With the help of numpy.ndarray.item() method, we can fetch the data elements that is found at the given index on numpy array. Remember we can give index as one dimensional parameter or can be two dimensional. Parameters: *args : Arguments (variable number and type) -> none: This argument only works 2 min read re.findall() in Python re.findall() method in Python helps us find all pattern occurrences in a string. It's like searching through a sentence to find every word that matches a specific rule. We can do this using regular expressions (regex) to create the pattern and then use re.findall() to get a list of matches.Let's say 2 min read re.finditer() in Python re.finditer() method in Python is used to search for all matches of a pattern in a string and return them as an iterator. In this article, we will explore about re.finditer() method in Python.Let's understand this with the help of an example:Pythonimport re text = "GFG, O, B, GFG, O" pattern = "GFG" 2 min read Like