Open In App

Numpy string operations | rindex() function

Last Updated : 29 Aug, 2020
Comments
Improve
Suggest changes
1 Like
Like
Report

 numpy.core.defchararray.rindex() function, raises ValueError when the substring sub is not found. Calls str.rindex element-wise.

Syntax : numpy.core.defchararray.rindex(arr, sub, start = 0, end = None)

Parameters :

arr : [array-like of str or unicode]  Array-like of str .

sub : [str or unicode] Input string or unicode.

start, end : [int, optional] Optional arguments start and end are interpreted as in slice notation.

Return : Return the output array of ints.

Code #1 :  

Output :  

27

Code #2 :  

Output : 

46


Next Article

Similar Reads