I'm a complete beginner to Pandas and wanted to know how to compare a row pair combination in one dataframe with another.
I have df:
id dates
0 A 2000-01-01
1 B 2000-01-02
2 C 2000-01-03
and wanted to compare this with df2:
id dates
0 A 2000-01-01
1 B 2000-01-03
2 C 2000-01-01
3 D 2000-01-04
4 E 2000-01-05
For each specific id in df2 it compares the corresponding date to df1 (and tells me if the date in df1 is on, or later than date in df2)
So I should get:
id dates later
0 A 2000-01-01 1
1 B 2000-01-02 0
2 C 2000-01-03 1
What's a good way to think about this?
Thanks!