【发布时间】:2017-10-31 16:43:32
【问题描述】:
给定熊猫的数据框(从数据库接收),我试图将结果输出到控制台,以使其完整和可读。
我面临的挑战是关于 2 列中的长文本:LPQ_REASON 和 LPQ_RESOLUTION。您会从下面的输出 (print df) 中注意到,两个 LPQ 列都以 3 个点 (...) 结尾,因此我无法阅读文本。尽管我的初始设置如下:
pd.set_option('display.max_rows', 1500)
pd.set_option('display.max_columns', 1500)
pd.set_option('display.width', 1000)
所以控制台上的结果如下所示:
ID DIS_CASE_ID CREATION_DATE type_2 LPQ_REASON LPQ_RESOLUTION RESOLUTION_CODE
0 727990 61180481 2017-01-05 13:47:05 7891 The LPQ we know is shorto add is 25% (h... This Memo was issued with conjunction to our j... 3979
1 727889 61180482 2017-01-05 13:51:09 7891 The LPQ he collide will increase 15% (h... This Memo was issued on matching viloation for... 3979
我正在寻找的最佳解决方案(如果可行的话)是打印整行,这样:
ID DIS_CASE_ID CREATION_DATE type_2 LPQ_REASON LPQ_RESOLUTION RESOLUTION_CODE
0 727990 61180481 2017-01-05 13:47:05 7891 The LPQ we know is shorto add is 25% (here This Memo was issued with conjunction to our 3979
comes the rest of the sentence. it might be analysis to foster a better bs when writing
long, or not, it might be short or whatever)
1 727889 61180482 2017-01-05 13:51:09 7891 The LPQ he collide will increase 15% yes and This Memo was issued on matching viloation for 3979
here I'm going to write the entire sentence who cares on what violation. just issued.
as if I really remember what was written. ha
【问题讨论】:
标签: python pandas alignment indentation