Python 3.x python相关矩阵取消堆栈并打印所有值

Python 3.x python相关矩阵取消堆栈并打印所有值,python-3.x,correlation,Python 3.x,Correlation,我正在尝试取消堆叠相关矩阵并打印值,我通过截断得到如下结果,即并非所有值都显示: corr_pairs = corr_dict['corr'].unstack() print(corr_pairs) Assignment Assignment 1.000000 Country/Region 0.242011

我正在尝试取消堆叠相关矩阵并打印值,我通过截断得到如下结果,即并非所有值都显示:

corr_pairs = corr_dict['corr'].unstack()
print(corr_pairs)

Assignment            Assignment                       1.000000
                      Country/Region                   0.242011
                      Interaction ID                   0.000000
                      Incident ID                      0.394528
                      Contact Last Name                0.667224
                                                         ...   
actual_end_plus_12hr  sImplementation on Time Scope   -0.209027
                      sImplementation on Time Met     -0.199003
                      sSuccess Rate Scope             -0.208897
                      sSuccess Rate Met               -0.208897
                      actual_end_plus_12hr             1.000000
Length: 4489, dtype: float64
然而,我希望无标记的相关矩阵的所有值都在不进行任何截断的情况下打印出来。大概是这样的:

corr_pairs = corr_dict['corr'].unstack()
print(corr_pairs)

Assignment            Assignment                       1.000000
                      Country/Region                   0.242011
                      Interaction ID                   0.000000
                      Incident ID                      0.394528
                      Contact Last Name                0.667224
actual_end_plus_12hr  sImplementation on Time Scope   -0.209027
                      sImplementation on Time Met     -0.199003
                      sSuccess Rate Scope             -0.208897
                      sSuccess Rate Met               -0.208897
                      actual_end_plus_12hr             1.000000
actual_end_plus_12hr  sImplementation on Time Scope   -0.209027
                      sImplementation on Time Met     -0.199003
                      sSuccess Rate Scope             -0.208897
                      sSuccess Rate Met               -0.208897
                      actual_end_plus_12hr             1.000000
actual_end_plus_12hr  sImplementation on Time Scope   -0.209027
                      sImplementation on Time Met     -0.199003
                      sSuccess Rate Scope             -0.208897
                      sSuccess Rate Met               -0.208897
                      actual_end_plus_12hr             1.000000
actual_end_plus_12hr  sImplementation on Time Scope   -0.209027
                      sImplementation on Time Met     -0.199003
                      sSuccess Rate Scope             -0.208897
                      sSuccess Rate Met               -0.208897
                      actual_end_plus_12hr             1.000000
Length: 4489, dtype: float64
我该怎么做呢?

我找到了答案:

print(df.to_string())

请提供一个例子。这个例子足够好,但是我也包括了期望的输出。不,它不够好。它应该是可复制的。这回答了你的问题吗?根据我的建议,我在这篇文章上做了标记。如果你解决这个问题,我会收回国旗。