I would like to add a column to df2 that includes a count of rows in df1 that have matching Herd and Ddat values.
import pandas as pd
df1 = [[52, '1', '1/1/2020'], [54, '1', '1/1/2020'],
[55, '2', '1/1/2020'], [56, '3', '1/1/1999']]
df = pd.DataFrame(df1, columns =['Cow','Herd', 'Ddat'])
df2 = [['1', '1/1/2020'], ['1', '1/5/2020'],
['2', '1/1/2020'], ['3', '1/1/1999']]
df2 = pd.DataFrame(df2, columns =['Herd', 'Ddat'])
The output I am looking for is
Herd Ddat Count
1 1/1/2020 2
1 1/5/2020 0
2 1/1/2020 1
3 1/1/1999 1