Assume I have a data set df which contains customer transactions
df
customer_id | brand ------------------- 1 | shoe 1 | shirt 2 | hat 3 | apple .