maxframe.dataframe.DataFrame.corrwith#
- DataFrame.corrwith(other, axis=0, drop=False, method='pearson')#
计算成对相关性。
在 DataFrame 的行或列与 Series 或 DataFrame 的行或列之间计算成对相关性。在计算相关性之前,首先沿两个轴对齐 DataFrames。
- 参数:
axis ({0 or 'index', 1 or 'columns'}, default 0) -- 使用的轴。0 或 'index' 表示按列计算,1 或 'columns' 表示按行计算。
drop (bool, default False) -- 从结果中删除缺失的索引。
method ({'pearson', 'kendall', 'spearman'} or callable) -- 相关方法: * pearson : 标准相关系数 * kendall : Kendall Tau 相关系数 * spearman : Spearman 秩相关 * callable: 可调用对象,输入为两个一维数组,返回一个浮点数。 .. note:: kendall、spearman 和可调用对象尚未支持多个块。
- 返回:
成对相关性。
- 返回类型:
参见
DataFrame.corr计算列的成对相关性。