title: Imputing missing/cutover values across multiple columns in a dataframe
body: <p>How would I go about imputing missing/cut-over values across multiple columns in a dataframe like below, with the following cases:</p>
  <ol>
  <li>Cases A &amp; C: Impute value for Month3 from average of Month2 and Month4 values</li>
  <li>Case B: Collapse two rows to fill in the 0 values across the four months</li>
  </ol>
  <pre class="lang-py prettyprint-override"><code>df_input = pd.DataFrame({'ID': ['A','B','B','C'],
               'Month1': [10, 15, 0, 0],
               'Month2': [20, 32, 0 , 100],
               'Month3': [0, 0, 45, 0],
               'Month4': [50, 0, 51, 400]})
  
  
  ID  Month1  Month2  Month3  Month4
  A   10      20      0       50
  B   15      32      0       0
  B   0       0       45      51
  C   0       100     0       400
  </code></pre>
  <p>My expected output dataframe would then be:</p>
  <pre class="lang-py prettyprint-override"><code>df_output = pd.DataFrame({'ID': ['A','B','C'],
               'Month1': [10, 15, 0],
               'Month2': [20, 32, 100],
               'Month3': [35, 45, 250],
               'Month4': [50, 51, 400]})
  
  ID  Month1  Month2  Month3  Month4
  A   10      20      35      50
  B   15      32      45      51
  C   0       100     250     400
  </code></pre>