Pandas Fill Column with Dictionary
<p>I have a data frame like this:</p>

<pre><code>   A    B    C    D    
0  1    0   nan  nan  
1  8    0   nan  nan  
2  8    1   nan  nan  
3  2    1   nan  nan  
4  0    0   nan  nan  
5  1    1   nan  nan  
</code></pre>

<p>and i have a dictionary like this:</p>

<pre><code>dc = {'C': 5, 'D' : 10}
</code></pre>

<p>I want to fill the <code>nan</code>values in the data frame with the dictionary but only for the cells in which the column B values are 0, i want to obtain this:</p>

<pre><code>   A    B    C    D    
0  1    0    5    10
1  8    0    5    10
2  8    1   nan  nan  
3  2    1   nan  nan  
4  0    0    5    10
5  1    1   nan  nan 
</code></pre>

<p>I know how to subset the dataframe but i can't find a way to fill the values with the dictionary; any ideas?</p>