New to pandas and trying to figure out filtering results from a dataframe based on data in another dataframe.
df1 df2
v1 v2 v1 v2
1 2 1 3
1 3 2 3
1 4 3 4
2 2
2 4
3 2
3 3
3 4
I have two dataframes: df1 and df2. I'm trying to create df3 which filters off results where if df1.v1 = df2.v1 and df1.v2 < df2.v2. This would yield df3 here:
df3
v1 v2
1 3
1 4
2 4
3 4
I'm not sure how to go about doing this. I'm thinking of maybe converting df2 to a dictionary (df.v1 are all unique).