-
statsmodels.tools.tools.add_constant(data, prepend=True, has_constant=‘skip’)
Add a column of ones to an array.
Parameter type mean data array_like A column-ordered design matrix prepend bool If True, the constant is in the first column has_constant str {‘raise’, ‘add’, ‘skip’} Behavior if data already has a constant. The default will return data without adding another constant.
If ‘raise’, will raise an error if any column has a constnat value.
Using ‘add’ will add a column of 1s if a constant column is present.Returns : array_like
The original values with a constant (column of ones) as the first or last column.
理解statsmodels.tools.tools.add_constant
猜你喜欢
转载自blog.csdn.net/The_Time_Runner/article/details/108209153
今日推荐
周排行