title: MAPE is producing inf as the output
body: <p>I am using MAPE metric for my linear regression model. The output is <code>inf</code>.</p>
  
  <p>The code looks like this:</p>
  
  <pre><code>import numpy as nm
  
  def MAPE(a, b):
      mape = nm.mean(nm.abs((a - b) / a)) * 100
      return mape
  
  MAPE(data.iloc[:, 1], pre)
  </code></pre>
  
  <p><code>pre</code> is the variable storing the predicted value.</p>
  
  <p>Can anyone suggest what is the glitch in this ?</p>