[Solved] Convert first 2 letters of all records to Uppercase in python
You may use map and Convert you data as you required: try below: import pandas as pd df = pd.DataFrame({‘name’:[‘geeks’, ‘gor’, ‘geeks’, ‘is’,’portal’, ‘for’,’geeks’]}) df[‘name’]=df[‘name’].map(lambda x: x[:2].upper()+x[2:]) print (df) output: name 0 GEeks 1 GOr 2 GEeks 3 IS 4 POrtal 5 FOr 6 GEeks demo 1 solved Convert first 2 letters of all records … Read more