Using pandas, how can I find the position of rows of one dataframe in another dataframe?
Example:
We have a dataframe df_A
import pandas as pd
df_A = pd.DataFrame([[1, 2,3], [1, 3,4], [1, 4,9]], columns=['idx_1', 'idx_2','values'])
and another dataframe df_B
df_B = pd.DataFrame([[1, 2], [1, 4]], columns=['idx_1', 'idx_2'])
I want to the correspondence between the idx-columns of df_A to the idx-columns of df_B:
idx_1 idx_2 values row_B
0 1 2 3 0
1 1 3 4 NAN
2 1 4 9 1