我有以下两个变量:
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))
这个输出:
Column vector type <class 'numpy.ndarray'> and shape (87145,)
Data frame type <class 'pandas.core.frame.DataFrame'> and shape (87145, 11)
我想插入target
列向量作为这个框架/矩阵的第一列。。。我该怎么做?你知道吗
我的最终目标是能够使用corr
函数计算附加到预测变量或设计矩阵的响应变量的相关矩阵。你知道吗
使用^{} :
对于类似
DataFrame
的相同长度数组:相关问题 更多 >
编程相关推荐