I am trying to compute the transition matrix from time-series data. I wrote a custom function like the following code that serves my purpose.
def compute_tran