I have a dataframe as follows, with many customers and only 2 products (A and B). It is possible for a customer to hold multiple instances of the same product (e.g customer 1 has 4 product A's in the below table). How can I get a list of all customer who hold both products A and B (regardless of quantity)? Thanks.
e.g. the below table should only return customer ID of 1 and 2 since customer 3 only holds product B.
| Customer ID | Product |
|---|---|
| 1 | A |
| 1 | B |
| 1 | A |
| 2 | A |
| 2 | A |
| 1 | A |
| 2 | B |
| 1 | A |
| 3 | B |
| 1 | A |
没有评论:
发表评论