title: Pandas: Imputing Missing Values to Data Frame
body: <p>Suppose I have a data frame with some missing values, as below:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame([[1,3,'NA',2], [0,1,1,3], [1,2,'NA',1]], columns=['W', 'X', 'Y', 'Z'])
  print(df)
  </code></pre>
  
  <p>The variable Y is missing two values. Say I run some imputation model and come up with an estimate of what the two values should be:</p>
  
  <pre><code>to_impute = [2,1]
  </code></pre>
  
  <p>What is the best way of replacing the two NA's with those two values? I know of ways that are fairly roundabout, e.g. looping over to_impute and using df.iloc to add each value. But I'm hoping there is a concise and non-iterative way. </p>
  
  <p>(This is something that is easy in R, and I'm hoping it can be easy in Pandas.)</p>