如何删除...打印出来并打印出Pycharm控制台中的完整句子?

问题描述 投票:0回答:1

下面显示的是pycharm中的输出控制台。我想展示一个长句打印出来,但它给了我......

                                             notes
0  {'Notes': "85 Male Malay  NKDA walking stick a...
1  {'Notes': '85yo chinese man nkda PHX 1) Hypert...

这是我用来实现打印输出的代码:

pd.set_option('display.width', 100000)
pd.set_option('display.max_rows', 5000, 'display.max_columns', 500)
df = pd.DataFrame(np.array(c3), columns=["notes"]).drop_duplicates()
print(df)
python pandas numpy dataframe pycharm
1个回答
0
投票

IIUC使用pd.options

pd.options.display.max_colwidth = 1000
pd.Series('this is very long long long long long long long long long string')
Out[39]: 
0    this is very long long long long long long long long long string
dtype: object

更新

pd.Series([{'LOL!':'this is very long long long long long long long long long stridddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddng','LOL2':'this is very long long long long long long long long long string'}])
Out[47]: 
0    {'LOL2': 'this is very long long long long long long long long long string', 'LOL!': 'this is very long long long long long long long long long stridddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddng'}
dtype: object
© www.soinside.com 2019 - 2024. All rights reserved.