My dataframe has a category and subcategory column, and then a column with strings that sometimes are repeated.
My question is for each category (CAT A) which strings are repeated across subcategories (CAT B)
| CAT A | CAT B | Strings |
|---|---|---|
| A1 | B1 | String1 |
| A1 | B1 | String2 |
| A1 | B1 | String3 |
| A1 | B2 | String4 |
| A1 | B2 | String5 |
| A1 | B2 | String1 |
| A2 | B1 | String1 |
| A2 | B1 | String2 |
| A2 | B1 | String3 |
| A2 | B2 | String4 |
| A2 | B2 | String5 |
| A2 | B2 | String6 |
The output I am looking for
A1
Repeated strings in B1 and B2
"String1"
---
A2
Repeated strings in B1 and B2
None
I'm confused on how to group this and compare the groups.
Thanks