NumPy String FunctionsNumPy contains the following functions for the operations on the arrays of dtype string.
numpy.char.add() method exampleOutput: Concatenating two string arrays: ['welcome to Javatpoint' 'Hi read python'] numpy.char.multiply() method exampleOutput: Printing a string multiple times: hello hello hello numpy.char.center() method exampleOutput: Padding the string through left and right with the fill char * *****Javatpoint***** numpy.char.capitalize() method exampleOutput: Capitalizing the string using capitalize()... Welcome to javatpoint numpy.char.title() method exampleOutput: Converting string into title cased version... Welcome To Javatpoint numpy.char.lower() method exampleOutput: Converting all the characters of the string into lowercase... welcome to javatpoint numpy.char.upper() method exampleOutput: Converting all the characters of the string into uppercase... WELCOME TO JAVATPOINT numpy.char.split() method exampleOutput: Splitting the String word by word.. ['Welcome', 'To', 'Javatpoint'] numpy.char.splitlines() method exampleOutput: Splitting the String line by line.. ['Welcome', 'To', 'Javatpoint'] numpy.char.strip() method exampleOutput: Original String: welcome to javatpoint Removing the leading and trailing whitespaces from the string welcome to javatpoint numpy.char.join() method exampleOutput: H:M numpy.char.replace() method exampleOutput: Original String: Welcome to Javatpoint Modified String: www. Javatpoint numpy.char.encode() and decode() method exampleOutput: b'\xa6\x85\x93\x83\x96\x94\x85@\xa3\x96@\x91\x81\xa5\x81\xa3\x97\x96\x89\x95\xa3' welcome to javatpoint Next TopicNumPy Mathematical Functions |