statsmodels.tools.tools.add_constant
statsmodels.tools.tools.add_constant(data, prepend=True, has_constant='skip') [source]
This appends a column of ones to an array if prepend==False. Parameters:
data : array-like data is the column-ordered design matrix prepend : bool True and the constant is prepended rather than appended. has_constant : str {?raise?, ?add?, ?skip?} Behavior if ``data?? already has a constant. The default will return data without adding another constant. If ?raise?,