Dataframe print 省略号问题
生活随笔
收集整理的這篇文章主要介紹了
Dataframe print 省略号问题
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
通過print輸出Dataframe中的數(shù)據(jù),當(dāng)Dataframe行數(shù)很多時(shí),中間部分顯示省略號.
通過查看pandas的官方文檔可知,pandas.set_option() 可以設(shè)置pandas相關(guān)的參數(shù),從而改變默認(rèn)參數(shù)。 打印pandas數(shù)據(jù)時(shí),默認(rèn)是輸出100行,多的話中間數(shù)據(jù)會輸出省略號。
在代碼中添加以下兩行代碼,可以改變顯示寬度和行數(shù),這樣就能完整地查看數(shù)據(jù)了
pd.set_option('display.width', 1000) # 設(shè)置字符顯示寬度
pd.set_option('display.max_rows', None) # 設(shè)置顯示最大行
pd.set_option('display.max_columns', None) # 設(shè)置顯示最大行
總結(jié)
以上是生活随笔為你收集整理的Dataframe print 省略号问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: GAE
- 下一篇: 博科Brocade系列光纤交换机报价 程