def add_const(features):
content = np.empty((features.shape[<NUM_LIT:0>], features.shape[<NUM_LIT:1>] + <NUM_LIT:1>), dtype='<STR_LIT>')<EOL>content[:, <NUM_LIT:0>] = <NUM_LIT:1.><EOL>if isinstance(features, np.ndarray):<EOL><INDENT>content[:, <NUM_LIT:1>:] = features<EOL>return content<EOL><DEDENT>content[:, <NUM_LIT:1>:] = features.iloc[:, :].values<EOL>cols = ['<STR_LIT>'] + features.columns.tolist()<EOL>return pd.DataFrame(data=content, index=features.index, columns=cols, dtype='<STR_LIT>')<EOL>
Prepend the constant feature 1 as first feature and return the modified
feature set.

Parameters
----------
features : ndarray or DataFrame