title: Populate Pandas DataFrame using a dictionary based on a condition
body: <p>I have a DataFrame</p>
  
  <pre><code>&gt;&gt; test = pd.DataFrame({'A': ['a', 'b', 'b', 'b'], 'B': [1, 2, 3, 4], 'C': [np.nan, np.nan, np.nan, np.nan], 'D': [np.nan, np.nan, np.nan, np.nan]})
      A   B   C   D
  0   a   1       
  1   b   2       
  2   b   3       
  3   b   4       
  </code></pre>
  
  <p>I also have a dictionary, where <code>b</code> in <code>input_b</code> signifies that I'm only modifying rows where <code>row.A = b</code>. </p>
  
  <pre><code>&gt;&gt; input_b = {2: ['Moon', 'Elephant'], 4: ['Sun', 'Mouse']}
  </code></pre>
  
  <p>How do I populate the DataFrame  with values from the dictionary to get</p>
  
  <pre><code>    A   B   C       D
  0   a   1       
  1   b   2   Moon    Elephant
  2   b   3       
  3   b   4   Sun     Mouse
  </code></pre>