Capitalize first letter of each word in the column Python Capitalize first letter of each word in the column Python python python

Capitalize first letter of each word in the column Python


You can use str.title:

print (df.Column1.str.title())0    The Apple1     The Pear2    Green TeaName: Column1, dtype: object

Another very similar method is str.capitalize, but it uppercases only first letters:

print (df.Column1.str.capitalize())0    The apple1     The pear2    Green teaName: Column1, dtype: object