उदाहरण
import pandas as pd
# एक डेटाफ्रेम
df = pd.DataFrame({'Day': ['mon', 'tue', 'wed', 'thu', 'fri'],
'Subject': ['Math', 'english', 'science', 'music', 'games']})
df['Day'] = df['Day'].str.upper()
print(df)
आउटपुट
Day Subject
0 MON Math
1 TUE english
2 WED science
3 THU music
4 FRI games
उदाहरण
# एक डेटाफ्रेम
df = pd.DataFrame({'Day': ['mon', 'tue', 'wed', 'thu', 'fri'],
'Subject': ['Math', 'english', 'science', 'music', 'games']})
df1 = df['Subject'].apply(lambda x: x.upper())
print(df1)
आउटपुट
0 MATH
1 ENGLISH
2 SCIENCE
3 MUSIC
4 GAMES
Name: Subject, dtype: object