Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

organize order columns dataframe

#create a new df to organize columns order
organized_df = pd.DataFrame({'col1':existing_df.col1, 'col2':existing_df.col2, 'col3':existing_df.col3)

#or

existing_df = existing_df.reindex(columns = ['col1','col3','col2'])
 
PREVIOUS NEXT
Tagged: #organize #order #columns #dataframe
ADD COMMENT
Topic
Name
1+5 =