title: Use Python to calculate P**n while n approach +oo and P is a matrix
body: <p>The code is </p>
  
  <pre><code>import sympy as sm
  import numpy as np
  
  k=sm.Symbol('k')
  p=np.matrix([[1./2,1./4,1./4],[1./2,0,1./2],[1./4,0,3./4]])
  sm.limit(p**k,k,sm.oo)
  </code></pre>
  
  <p>It indicates 'TypeError: exponent must be an integer'. But if I change the matrix to a constant like this
      <code>sm.limit(2**k,k,sm.oo)</code>
  , it could print the correct answer. So how can I deal with this problem? Thanks for your help!</p>