Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

renaming column in dataframe pandas

df.rename({'a': 'X', 'b': 'Y'}, axis=1, inplace=True)
df

   X  Y  c  d  e
0  x  x  x  x  x
1  x  x  x  x  x
2  x  x  x  x  x
 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #renaming #column #dataframe #pandas
ADD COMMENT
Topic
Name
6+3 =