Merging two pandas dataframes
I would normally suggest something like 

merged_df = pd.merge(df_compiler, df_opt, on="instructions")


But the third image you posted does not really look like the inner merge of the other two. Can you describe what exactly you are trying to achieve in a little more detail? The third one looks like ten times longer than the other two.