Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

change column order dataframe python

# create a dataframe
df = pd.DataFrame({'B':[1,2],'A':[0,0],'C':[1,1]})
# reorder columns as ['A','B','C']
df = df.reindex(columns = ['A','B','C'])
 
PREVIOUS NEXT
Tagged: #change #column #order #dataframe #python
ADD COMMENT
Topic
Name
3+7 =