title: Ignore zero values and continue with calculation in Python Pandas
body: <p>Is there a way I could continue with my calculation ignoring the Zero division error by ensuring Python returns a default zero for a Divide by Zero result.
  Here is the block of code below:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  data = {'Sales': [5000, 4000], 
      'COS': [0, 0], 
      'Inventory': [400, 500], 
      'Receivables': [150, 400], 
      'Days': [365, 366],}
  df = pd.DataFrame(data, columns = ['Sales', 'COS', 'Inventory', 'Receivables', 'Days'])
  df
  
  sales = (data['Sales'][0])
  cos = (data['COS'][0])
  inv = (data['Inventory'][0])
  recei = (data['Receivables'][0])
  days = (data['Days'][0])
  
  ans = (inv/(cos/days)) + (recei/(sales/days))
  </code></pre>
  
  <p>Apparently when I run it, it gives the ZeroDivisionError. Using the Try statement has not really given me a suitable solution. I would really love a solution that can be applied directly on the dataframe just incase other values too returns zero</p>
  
  <p><strong>Ideally accounting-wise, my ans should be 10.95</strong></p>
  
  <p>Thanks in advance.</p>