title: Handling division by zero in Pandas calculations
body: <p>I have the following data:</p>
  
  <pre><code>a = pd.Series([1, 2, 3])
  b = pd.Series([0, 0, 0])
  </code></pre>
  
  <p>If there is a division by zero I want to in some cases</p>
  
  <ol>
  <li>set the result to one of the series</li>
  <li>set the result to a specific value</li>
  </ol>
  
  <p>But the following give "unexpected" results:</p>
  
  <pre><code>a.div(b, fill_value = 0)
  0    inf
  1    inf
  2    inf
  
  a.div(b).fillna(0)
  0    inf
  1    inf
  2    inf
  
  a.div(b).combine_first(a)
  0    inf
  1    inf
  2    inf
  </code></pre>
  
  <p>I want to arrive at:</p>
  
  <p><strong>case 1</strong>: set the data to a specific value</p>
  
  <pre><code>0    0
  1    0
  2    0
  </code></pre>
  
  <p><strong>case 2</strong>: set the value to a specific series</p>
  
  <pre><code>0    1
  1    2
  2    3
  </code></pre>