My goal is to add a column which counts the number of unique instances of a primary key in dfB using the keys in dfA. dfA has the primary key only show up once while dfB would have the primary key multiple times.
Example.
dfA
| Agreement | Date_1 |
|---|---|
| 146108493 | 1/31/2019 |
| 142527722 | 1/9/2019 |
dfB
| Agreement | Date_2 |
|---|---|
| 146108493 | 2/4/2019 |
| 146108493 | 2/15/2019 |
| 146108493 | 2/20/2019 |
| 142527722 | 2/28/2019 |
| 142527722 | 3/15/2019 |
Goal Outcome- adjusted dfA
| Agreement | Date_1 | Count |
|---|---|---|
| 146108493 | 1/31/2019 | 3 |
| 142527722 | 1/9/2019 | 2 |