title: Python's Statsmodels glm throws PerfectSeparationError, R returns results
body: <p>I am trying to port some prototype R code into Python, and I'm having issues mapping from stats::glm in R. The first test set returns reasonable looking values in R, but fails out in python.</p>
  
  <p>The Python code:</p>
  
  <pre><code>import numpy
  import pandas
  from statsmodels.formula.api import glm
  from statsmodels.api import families
  from statsmodels.genmod.families.links import logit
  
  my_data = pandas.DataFrame({
      'success': [1, 0, 1, 1, 0, 0, 1, 1, 0, 1],
      'col_a': [5000.0, 10000.0, 11000, 20000.0, 20000.0, 25000.0, 30000.0, 30000.0, 40000.0, 41000.0],
      'col_b': ['a', 'a', 'b', 'b', None, 'b', 'c', 'c', None, 'd'],
      'col_c': [5487.0, 5654, numpy.NaN, 2918.0, 912.0, numpy.NaN, 1236.0, 234.0, 2390.0, 21092.0],
  })
  formula = 'success ~ col_a + col_b + col_c'
  
  result = glm(formula, family=families.Binomial(link=logit), data=my_data, missing='drop').fit()
  
  # Throws statsmodels.tools.sm_exceptions.PerfectSeparationError:
  #    Perfect separation detected, results not available
  </code></pre>
  
  <p>The R code</p>
  
  <pre><code>library(stats)
  my_data = data.frame(
      success=c(1, 0, 1, 1, 0, 0, 1, 1, 0, 1),
      col_a=c(5000.0, 10000.0, 11000.0, 20000.0, 20000.0, 25000.0, 30000.0, 30000.0, 40000.0, 41000.0),
      col_b=c('a', 'a', 'b', 'b', NA, 'b', 'c', 'c', NA, 'd'),
      col_c=c(5487.0, 5654.0, NA, 2918, 912.0, NA, 1236.0, 234.0, 2390.0, 21092.0)
  )
  myFormula &lt;- stats::formula(paste0("success ~ col_a + col_b + col_c"))
  fit &lt;- stats::glm(myFormula, data=my_data, family=stats::binomial(link="logit"), na.action=stats::na.exclude) 
  summary(fit)
  
  Call:
  stats::glm(formula = myFormula, family = stats::binomial(link = "logit"), 
      data = my_data, na.action = stats::na.exclude)
  
  Deviance Residuals: 
   [1]  0  0     0        0  0     0
  
  Coefficients:
                Estimate Std. Error z value Pr(&gt;|z|)
  (Intercept)  7.370e+01  1.026e+06       0        1
  col_a       -9.826e-03  3.757e+01       0        1
  col_bb       1.474e+02  7.500e+05       0        1
  col_bc       2.457e+02  1.334e+06       0        1
  col_bd       3.538e+02  2.943e+06       0        1
  col_c        3.282e-12  1.849e+02       0        1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 5.4067e+00  on 5  degrees of freedom
  Residual deviance: 2.5720e-10  on 0  degrees of freedom
    (4 observations deleted due to missingness)
  AIC: 12
  
  Number of Fisher Scoring iterations: 23
  </code></pre>
  
  <p>In reading other StackOverflow posts, the typical issue is a success variable with only one value, or a single predictor which perfectly captures the success variable. However, at least by human inspection that isn't present here (and R doesn't indicate it). I'm wondering if there's some hidden defaults which differ between Python and R, but a cursory analysis hasn't found any.</p>