numpy.defchararray.capitalize() in Python Last Updated : 28 Nov, 2018 Comments Improve Suggest changes Like Article Like Report numpy.core.defchararray.multiply(arr, n): Capitalizes the first letter of string element-wise. Parameters: arr : array-like or string. Returns : Capitalized first letter of the string. Code #1: Python3 1== # Python Program illustrating # numpy.char.capitalize() method import numpy as np arr1 = ['eAAAaeAAAa', 'ttttdsttttds', 'AAtAAt'] arr2 = ['11sf', 'sdsf2', '1111f2'] print ("arr1 : ", arr1) print ("arr2 : ", arr2) Print("\nArrays after using capitalize():") print ("\narr1 : ", np.char.capitalize(arr1)) print ("arr2 : ", np.char.capitalize(arr2)) Output: arr1 : ['eAAAaeAAAa', 'ttttdsttttds', 'AAtAAt'] arr2 : ['11sf', 'sdsf2', '1111f2'] Arrays after using capitalize(): arr1 : ['Eaaaaeaaaa' 'Ttttdsttttds' 'Aataat'] arr2 : ['11sf' 'Sdsf2' '1111f2'] Code #2: Python3 1== # Python Program illustrating # numpy.char.capitalize() method import numpy as np arr1 = 'this is geeks ' arr2 = 'for geeks ' print ("arr1 : ", arr1) print ("arr2 : ", arr2) Print("\nArrays after using capitalize():") print ("\narr1 : ", np.char.capitalize(arr1)) print ("arr2 : ", np.char.capitalize(arr2)) Output: arr1 : this is geeks arr2 : for geeks Arrays after using capitalize(): arr1 : This is geeks arr2 : For geeks Comment More infoAdvertise with us Next Article numpy.defchararray.capitalize() in Python mohit gupta_omg :) Follow Improve Article Tags : Python Python-numpy Python numpy-String Operation Practice Tags : python Similar Reads numpy.defchararray.center() in Python numpy.core.defchararray.center(arr, width, fillchar): Centers the element of the string element-wise. Parameters: arr : array-like or string. width : Length of resulting string. fillchar : Padding character. Default is space.Returns : Copy of array with centered string. Code #1:  Python3 # Python 1 min read numpy.defchararray.add() in Python numpy.core.defchararray.add(arr1, arr2): Concatenates two strings element-wise. Parameters: arr1 : array-like or string. arr2 : array-like or string. Returns : Concatenates String. Code #1: Python3 1== # Python Program illustrating # numpy.char.add() method import numpy as np arr1 = ['vdteteAAAa', ' 1 min read numpy.defchararray.decode() in Python numpy.core.defchararray.decode(arr, encoding): This numpy function decode the string(object) based on the specified codec. Parameters: arr : array-like or string. encoding : [str] Name of codec being followed. error : Specifying how to handle error. Returns : Decoded string Code: Python3 1== # Pytho 1 min read numpy.defchararray.multiply() in Python numpy.core.defchararray.multiply(arr, n): Concatenates strings 'n' times element-wise. Parameters: arr : array-like or string. n : [array-like] no. of times we want to concatenate. Returns : Concatenated String 'n' times element-wise. Code #1: Python3 1== # Python Program illustrating # numpy.char.m 1 min read String capitalize() Method in Python The capitalize() method in Python is used to change the first letter of a string to uppercase and make all other letters lowercase. It is especially useful when we want to ensure that text follows title-like capitalization, where only the first letter is capitalized.Let's start with a simple example 2 min read Capitalize Each String in a List of Strings in Python In Python, manipulating strings is a common task, and capitalizing each string in a list is a straightforward yet essential operation. This article explores some simple and commonly used methods to achieve this goal. Each method has its advantages and use cases, providing flexibility for different s 3 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 Python Capitalize First Letter of Every Word in String There are different ways to capitalize the first letter of every word in a string using Python. We will cover methods such as using str.capitalize(), loops and regular expressions to achieve this text formatting task.Using str.title()str.title() method in Python converts the first character of each 3 min read Python | Pandas Series.str.capitalize() Series.str.capitalize() used to capitalize the string elements in pandas series. Series is a type of data structure which is used as same as list in python. Series can contain the different types of data as we want to enter in the series like list. Syntax : Series.str.capitalize() Parameters: None R 2 min read Capitalize first letter of a column in Pandas dataframe Analyzing real-world data is somewhat difficult because we need to take various things into consideration. Apart from getting the useful data from large datasets, keeping data in required format is also very important. One might encounter a situation where we need to capitalize any specific column i 2 min read Like