statsmodels.tools.tools.add_constant(data, prepend=True, has_constant='skip')
[source]
Adds a column of ones to an array
Parameters: |
|
---|---|
Returns: |
data – The original values with a constant (column of ones) as the first or last column. Returned value depends on input type. |
Return type: |
array, recarray or DataFrame |
When the input is recarray or a pandas Series or DataFrame, the added column’s name is ‘const’.
© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.tools.tools.add_constant.html