Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas order dataframe by column of other dataframe

df1 = df1.set_index('column_in_df1')
df1 = df1.reindex(index=df2['column_in_df2'])
df1 = df1.reset_index()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #order #dataframe #column #dataframe
ADD COMMENT
Topic
Name
6+4 =