numpy string operations | upper() function Last Updated : 14 Jan, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report numpy.core.defchararray.upper(arr): function is used to return an array with the elements converted to uppercase. Parameters: arr : [ array_like ] Input array which may be str or unicode. Returns : [ndarray] Output uppercased array of str or unicode, depending on input type. Code #1: Python3 # Python Program explaining # numpy.char.upper() function import numpy as geek in_arr = geek.array(['p4q r', '4q rp', 'q rp4', 'rp4q']) print ("input array : ", in_arr) out_arr = geek.char.upper(in_arr) print ("output uppercased array :", out_arr) Output: input array : ['p4q r' '4q rp' 'q rp4' 'rp4q'] output uppercased array : ['P4Q R' '4Q RP' 'Q RP4' 'RP4Q'] Code #2: Python3 # Python Program explaining # numpy.char.upper() function import numpy as geek in_arr = geek.array(['geeks', 'for', 'geeks']) print ("input array : ", in_arr) out_arr = geek.char.upper(in_arr) print ("output uppercased array :", out_arr ) Output: input array : ['geeks' 'for' 'geeks'] output uppercased array : ['GEEKS' 'FOR' 'GEEKS'] Comment More infoAdvertise with us Next Article numpy string operations | upper() function J jana_sayantan Follow Improve Article Tags : Python Python-numpy Python numpy-String Operation Practice Tags : python Similar Reads Numpy - String Functions & Operations NumPy String functions belong to the numpy.char module and are designed to perform element-wise operations on arrays. These functions can help to handle and manipulate string data efficiently.Table of ContentString OperationsString Information String Comparison In this article, weâll explore the var 5 min read numpy string operations | title() function numpy.core.defchararray.title(arr): function is used to Return element-wise title cased version of string or unicode.Title case words start with uppercase characters, all remaining cased characters are lowercase. Parameters: arr : [ array_like ] Input array which may be str or unicode. Returns : [nd 1 min read numpy string operations | swapcase() function numpy.core.defchararray.swapcase(arr) function return element-wise a copy of the string with uppercase characters converted to lowercase and lowercase characters converted to uppercase. Syntax: numpy.char.swapcase(arr) Parameters: arr : [ array_like ] Input array which may be str or unicode. Returns 1 min read numpy string operations | lower() function numpy.core.defchararray.lower(arr) function is used to return an array with the elements converted to lowercase. Parameters: arr : [ array_like ] Input array which may be str or unicode. Returns : [ndarray] Output lowercased array of str or unicode, depending on input type. Code #1: Python3 # Python 1 min read Numpy string operations | rindex() function 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 1 min read Like