I am working on a problem where i want to count the occurrences. I have an excel sheet containing customer data. I found out that people brought similar products. eg- lets assume someone brought a new mobile phone, most of the time they brought a Powerbank. The order id will be same for this two orders. How to i count the occurrences to deduce that if people buy one product they are likely to buy other.
Input:
----------------------------------------------|
order id | Name | product |
----------|-------------|---------------------|
123456 | Will Smith | mobile phone |
123456 | Will Smith | power bank |
123456 | Will Smith | charger |
234567 | adam smith | mobile phone |
234567 | adam smith | power bank |
345678 | sam smith | mobile phone |
345678 | sam smith | charger |
345678 | sam smith | headphone |
345672 | Ash smith | mobile phone |
345672 | Ash smith | charger |
345673 | kim smith | headphone |
----------------------------------------------|
expected Output
----------------------------------------------|
order id | Name | product |
----------|-------------|---------------------|
123456 | Will Smith | mobile phone |
123456 | Will Smith | power bank |
123456 | Will Smith | charger |
234567 | adam smith | mobile phone |
234567 | adam smith | power bank |
output should contain both mobile phone and power bank.
