str.upper() str.lower() str.title(): Convert the cases of the font.

import pandas as pd 
my_dict={'NAME':['Ravi','Raju','Alex']}
df = pd.DataFrame(data=my_dict)
print(df.NAME.str.upper()) # convert Lower case to Upper case 
Output
0    RAVI
1    RAJU
2    ALEX

lower() : Upper case to Lower case

import pandas as pd 
my_dict={'NAME':['Ravi','Raju','Alex']}
df = pd.DataFrame(data=my_dict)
print(df.NAME.str.lower())
Output
0    ravi
1    raju
2    alex

title(): First char of each word to Upper case

import pandas as pd 
my_dict={'NAME':['ravi ron','raju geek','alex john']}
df = pd.DataFrame(data=my_dict)
print(df.NAME.str.title())
Output
0     Ravi Ron
1    Raju Geek
2    Alex John

capitalize(): First Char to Upper case

import pandas as pd 
my_dict={'NAME':['ravi ron','raju geek','alex john']}
df = pd.DataFrame(data=my_dict)
print(df.NAME.str.capitalize())
Output
0     Ravi ron
1    Raju geek
2    Alex john

swapcase(): Convert Lower to Uppper and Upper to Lower case

import pandas as pd 
my_dict={'NAME':['Ravi Ron','Raju Geek','Alex John']}
df = pd.DataFrame(data=my_dict)
print(df.NAME.str.swapcase())
Output
0     rAVI rON
1    rAJU gEEK
2    aLEX jOHN


Pandas contains() split() slice()
Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



Subscribe to our YouTube Channel here



plus2net.com







Python Video Tutorials
Python SQLite Video Tutorials
Python MySQL Video Tutorials
Python Tkinter Video Tutorials
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer