python pandas change column values to all caps
# rename Pandas columns to lower case
df.columns= df.columns.str.lower()
df.columns
Index(['column1', 'column2', 'column3'], dtype='object')
4.11
9
# Creating 'columnB' that has Uppercase versions of all of columnA's values
df['columnB'] = df['columnA'].str.upper()
Thank you!
9
0
4.2
10
data.columns = [x.lower() for x in data.columns]
Thank you!
10
0
4.25
4
data.columns = map(str.lower, data.columns)
Thank you!
4
0
Are there any code examples left?
New code examples in category Python