Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

make first row columns pandas

new_header = df.iloc[0] #grab the first row for the header
df = df[1:] #take the data less the header row
df.columns = new_header #set the header row as the df header
Comment

PREVIOUS NEXT
Code Example
Python :: thousands separator python 
Python :: python confidence interval 
Python :: python add 1 to count 
Python :: matoplotlib set white background 
Python :: python tk fullscreen 
Python :: discord.py unmute 
Python :: How do I set Conda to activate the base environment by default? 
Python :: search string array python 
Python :: python split path at level 
Python :: fill python list with input 
Python :: python sqrt import 
Python :: pandas series values into strings 
Python :: Install requests-html library in python 
Python :: python combine side by side dataframes 
Python :: pytesseract tesseract is not installed 
Python :: timedelta year python 
Python :: python Key–value database 
Python :: python count the frequency of words in a list 
Python :: python blender select object by name 
Python :: squared sum of all elements in list python 
Python :: filter with different operator in django 
Python :: rename column name pandas dataframe 
Python :: python requests wait for page to load 
Python :: train test split stratify 
Python :: read csv python pandas plot 
Python :: column string to datetime python 
Python :: get list input from user in python 
Python :: installing django celery beat pip 
Python :: selenium page down key python 
Python :: pyttsx3 pip 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =