【问题标题】:python correlation matrix unstack and print all valuespython相关矩阵取消堆叠并打印所有值
【发布时间】:2020-08-18 17:59:43
【问题描述】:

我正在尝试解开相关矩阵并打印值,我得到类似这样的截断信息,即并非所有值都显示:

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

我该怎么做?

【问题讨论】:

标签: python-3.x correlation


【解决方案1】:

我找到了答案:

print(df.to_string())

【讨论】:

  • 根据this,我正在标记这篇文章。如果你解决了这个问题,我会收回这个标志。
猜你喜欢
  • 2014-03-02
  • 1970-01-01
  • 2019-08-05
  • 2019-07-15
  • 2019-10-07
  • 1970-01-01
  • 1970-01-01
  • 2014-08-28
  • 1970-01-01
相关资源
最近更新 更多