import numpy
import statsmodels.api as sm
y = numpy.array([1, 2, 3, 4, 5, 6, 7, 8, 9])
X = numpy.array([1, 1, 2, 2, 3, 3, 4, 4, 5])
X = sm.add_constant(X)
res_ols = sm.OLS(y, X).fit()
res_ols.params
Why do I get only one parameter from a statsmodels OLS fit