Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

How to set "Unnamed: 0" column as the index in a DataFrame

pd.read_csv('file.csv', index_col=[0])
Comment

Python additional Unnamed: 0 Column on Dataframe

#You should save the dataframe like this to avoid the problem
df.to_csv(index=False)

#But if the file is already with this Unnamed: 0
pd.read_csv('path/to/file', index_col=[0])
Comment

PREVIOUS NEXT
Code Example
Python :: check empty dataframe 
Python :: pandas read csv without index 
Python :: django desc order 
Python :: how to decode hexadecimal in python 
Python :: ignore bad lines pandas 
Python :: how to write words on any other apps in python 
Python :: regex to find ip address python 
Python :: print(DATA.popitem()) 
Python :: hoe maak je machten in python 
Python :: olst = [] a = int(input()) b = int(input()) for ele in range(a,b+1): if ele%2 != 0: olst.append(ele) print(olst[::-1]) 
Python :: den pfad der python datei rausfinden 
Python :: function python to get the minimu and its position 
Python :: python program for simple interest 
Python :: cv2 gaussian blur 
Python :: python scatter plot 
Python :: how to install library in python 
Python :: moving average numpy 
Python :: most occurring string in column pandas 
Python :: what do i do if my dog eats paper 
Python :: python selenium go back to previous page 
Python :: length of list in jinja 
Python :: pypi toml 
Python :: django admin table columns wrap text into multiple lines django 
Python :: pros and cons of python flush print function 
Python :: python strftime microseconds 
Python :: chiffre cesar python 
Python :: how to activate virtual environment in python 
Python :: choosing the correct lower and upper bounds in cv2 
Python :: selenium python download mac 
Python :: load csv file using pandas 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =