title: ZeroDivisionError: float division by zero (python 3.6)
body: <p>I am using the below code to bypass divide by zero error still getting one, not able to figure out what's actually going wrong here. </p>
  
  <pre><code>df.loc[:,'B to A Ratio'] =np.where(df.loc[:,'A']!=0,df.loc[:,'B']/df.loc[:,'A'],np.nan)
  </code></pre>
  
  <p>FYI, I am doing this operation on a data frame created from pivot table. Column 'A' &amp; 'B' here are just for Illustration.</p>