title: Regression in Python
body: <p>Trying to do logistic regression through pandas and statsmodels.  Don't know why I'm getting an error or how to fix it.</p>
  
  <pre><code>import pandas as pd
  import statsmodels.api as sm
  x = [1, 3, 5, 6, 8]
  y = [0, 1, 0, 1, 1]
  d = { "x": pd.Series(x), "y": pd.Series(y)}
  df = pd.DataFrame(d)
  
  model = "y ~ x"
  glm = sm.Logit(model, df=df).fit()
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code>Traceback (most recent call last):
    File "regress.py", line 45, in &lt;module&gt;
      glm = sm.Logit(model, df=df).fit()
  TypeError: __init__() takes exactly 3 arguments (2 given)
  </code></pre>