title: Python 3.8 Raise matrix to power of -1 results in inf
body: <p>I have a simple matrix in Python:</p>
  <pre><code>[[1134.01    0.  ]
   [   0.   1134.01]]
  </code></pre>
  <p>And I need to raise it to the power of -1.  I have tried</p>
  <pre><code>mat**-1 and mat = pow(mat, -1)
  </code></pre>
  <p>Both methods give me an infinity in the 0 place (I get it you can't divide by zero). The result looks like:</p>
  <pre><code>[[0.00088183        inf]
   [       inf 0.00088183]]
  </code></pre>
  <p>And it gives me this warning because it is trying to divide by zero:</p>
  <pre><code>RuntimeWarning: divide by zero encountered in reciprocal
  </code></pre>
  <p>So other than manually replacing the inf with 0 or adding a small value to my original matrix, is there a way to tell python not to produce the inf and put a 0 instead?</p>