Here is some sample data
d = {'sample1_reads': [1, 64, 53, 72, 16],
'sample1_r.variant': ['r.79_80ins79+1_79+76', 'r.79_80ins79+10857_79+10938',
'r.79_80ins80-13725_80-13587', 'r.79_80ins80-5488_80-5435', 'r.79_80ins79+2861_79+2900'],
'sample2_reads': [0, 3, 6, 9, 11],
'sample2_r.variant': ['r.5333_5406del', 'r.4186_4188del', 'r.5333_54106del', 'r.2345_2345fad', 'r.65456_w56sjfy']}
df = pd.DataFrame(d)
rdot = pd.DataFrame(['r.79_80ins79+1_79+76', 'r.646_729del', 'r.5333_5406del', 'r.79_80ins80-5488_80-5435', 'r.79_80ins79+2861_79+2900'], columns=['r_dot'])
If you just want to filter for first frame based on the second frame then you can do the following
# reshape your current data frame
new_df = pd.DataFrame(df.values.reshape((-1,2)), columns=['reads', 'variant'])
# use boolean indexing to filter your new data frame
df_f = new_df[new_df['variant'].isin(rdot['r_dot'])]
reads variant
0 1 r.79_80ins79+1_79+76
1 0 r.5333_5406del
6 72 r.79_80ins80-5488_80-5435
8 16 r.79_80ins79+2861_79+2900
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…