title: Missing values imputation for categorical variables in Python
body: <p>I'm seeking for a good imputation method for this case.
  I have a dataframe with categorical variables and missing data like the following one: </p>
  
  <pre><code>    import pandas as pd
  
  
  var1 = ['a','a','a','c','e',None]
  var2 = ['p1','p1','p1','p2','p3','p1']
  var3 = ['o1','o1','o1','o2','o3','o1']
  
  df = pd.DataFrame({'v1':var1,'v2':var2,'v3':var3})
  </code></pre>
  
  <p>I'm looking for an imputation method in python (could be R as well) that support just categorical variables. The idea is to  predict var1 given var2 and var3.
  For example, if we want to predict the NONE value that is in var1. We certainly know that the probability of var1='a' given var2='p1' and var3 = 'o1' is 1. I mean, P(var1='a' / (var2='p1',var3='o1') = 3/3 = 1. I thought about programming something like conditional modes but maybe someone already programmed this or there's a better algorithm for this. 
  I just have 3 categorical variables with multiple categories, whose missing values are MCAR. It is very important to mention that my dataset has around a more than a million rows (and about 10% of NAs). </p>
  
  <p>Do you have anything to recommend me?</p>
  
  <p>Thanks in advance,
  Tomas</p>