I have the following two variables:
print('Column vector type %s and shape %s' % (type(target), target[0:X_train.shape[0]].shape))
print('Data frame type %s and shape %s' % (type(X_train), X_train.shape))
and this outputs:
Column vector type <class 'numpy.ndarray'> and shape (87145,)
Data frame type <class 'pandas.core.frame.DataFrame'> and shape (87145, 11)
I'd like to insert the target
column vector as first column for this frame / matrix ... how can I do that?
My ultimate goal is to be able to compute the correlation matrix of the response variable appended to the predictor variables or design matrix using the corr
function.