Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to change a header in pandas

# Can just use df.columns to rename

>>> df = pd.DataFrame({'$a':[1,2], '$b': [10,20]})
>>> df.columns = ['a', 'b']
>>> df
   a   b
0  1  10
1  2  20
Comment

PREVIOUS NEXT
Code Example
Python :: dataframe get index name 
Python :: python 2d array to dataframe 
Python :: how to find magnitude of complex number in python 
Python :: serial clear buffer python 
Python :: unzip_data python 
Python :: how to take input from user in python 
Python :: python datetime format 
Python :: numpy normalize 
Python :: password generator in python 
Python :: sklearn logistic regression get probability 
Python :: left join outer apply 
Python :: python sizeof 
Python :: append one row to pandas dataframe 
Python :: macos set default python version 
Python :: python use variable in regex expression 
Python :: loop append to list python 
Python :: python decimal to string 
Python :: what is kali 
Python :: Palindrome Check using for loop in python 
Python :: images in django 
Python :: how to make a pause in python 
Python :: how to reboot a python script 
Python :: MovieWriter stderr: ffmpeg: error while loading shared libraries: libopenh264.so.5: cannot open shared object file: No such file or directory 
Python :: threading python 
Python :: round up division python 
Python :: how to change font in tkinter 
Python :: divide a column value in pandas dataframe 
Python :: django orm count 
Python :: python writelines 
Python :: pandas gropu by 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =