I have 2 dataframe. The size of the df_1 is 1272464 bytes (1.2 Mb), 65893 objects, and 3 variables and df_2 is 3507976 bytes (3.7 Mb), 202732 objects, and 2 variables.
I am using a function to sort the columns of the dataframe and then merge these 2 dataframe. Code is given below
I am attempting to find another way to get to your result but something seems odd to me in the way you wrote your function. For example, Leucodelphinidin is under the query column in df_2; however, after running your function: sc(df_2, 1:2), the entry becomes a target instead. I understand that this is due to you using the sort function on rows. Is that really what you want? Because this is basically changing the nature of your data.
@gueyenono thank you very much for catching the mistakes. No, I do not want to change the data from query to target or vice versa. That's means, I have to check the function again!