python相关矩阵解堆并打印所有值

问题描述

我试图拆开相关矩阵并打印值,但截断后得到类似的结果,即并非所有值都显示出来:

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())