I am looking for a way to compute a Markov transition matrix from a customer transactions list of an ecommerce website.
Basically I would need a nxn matrix with n as the number of purchased products, and in each row there would be the probability of let's say, purchasing product 1 , I have X probability of purchasing product 2, y probability of purchasing product 1 again, and so on. We can assume the initial state to be an array with a 1 on product 1 and a 0 for all the other products (we just bought product 1 for now).
Is there some sort of python package able to compute the transition matrix probabilities for me feeding the purchase data? In all the examples I looked at people were just feeding a pre computed matrix.
Thanks in advance