In df1 I have columns for Line, Generation, ID, and Sex.
I want to count matching occurrences in df2 of the remaining columns for each row.
The desired result would look like:
Line A, Generation 2020A, has a total of
1row for row['A','A','A','A']indf2.Line B, Generation 2020B, has a total of
2rows for row['A','C','T','G']indf2.
df1
| Line | ID | Sex | Generation | SNP-1 | SNP-2 | SNP-3 | SNP-4 |
|---|---|---|---|---|---|---|---|
| A | 1 | F | 2020A | A | A | A | A |
| B | 2 | F | 2020B | A | C | T | G |
| B | 3 | F | 2020B | A | C | T | G |
df2
| SNP-1 | SNP-2 | SNP-3 | SNP-4 |
|---|---|---|---|
| A | A | A | A |
| A | C | T | G |