Jupyter-設(shè)置顯示行數(shù)列數(shù)

1 數(shù)據(jù)表顯示所有行和列

pd.set_option('max_columns',None)
pd.set_option('max_row',None)

設(shè)置為 None,會(huì)顯示所有的行和列烁落。
只設(shè)置為數(shù)字的時(shí)候無效席揽。

2 列內(nèi)值省略消除

pd.set_option('max_colwidth',200)
pd.set_option('display.width',200)
pd.set_option('display.max_columns',200)

在jupyter部分版本不生效

3 關(guān)于set_option所有的參數(shù)介紹

Available options:

- display.[chop_threshold, colheader_justify, column_space, date_dayfirst,

  date_yearfirst, encoding, expand_frame_repr, float_format, height, large_repr]

- display.latex.[escape, longtable, repr]

- display.[line_width, max_categories, max_columns, max_colwidth,

  max_info_columns, max_info_rows, max_rows, max_seq_items, memory_usage,

  mpl_style, multi_sparse, notebook_repr_html, pprint_nest_depth, precision,

  show_dimensions]

- display.unicode.[ambiguous_as_wide, east_asian_width]

- display.[width]

- io.excel.xls.[writer]

- io.excel.xlsm.[writer]

- io.excel.xlsx.[writer]

- io.hdf.[default_format, dropna_table]

- mode.[chained_assignment, sim_interactive, use_inf_as_null]

Parameters

----------

pat : str

Regexp which should match a single option.

Note: partial matches are supported for convenience, but unless you use the

full option name (e.g. x.y.z.option_name), your code may break in future

versions if new options with similar names are introduced.

value :

 new value of option.

Returns

-------

None

Raises

------

OptionError if no such option exists

Notes

-----

The available options with its descriptions:

display.chop_threshold : float or None

 if set to a float value, all float values smaller then the given threshold

will be displayed as exactly 0 by repr and friends.

    [default: None] [currently: None]

display.colheader_justify : 'left'/'right'

Controls the justification of column headers. used by DataFrameFormatter.

    [default: right] [currently: right]

display.column_space No description available.

    [default: 12] [currently: 12]

display.date_dayfirst : boolean

 When True, prints and parses dates with the day first, eg 20/01/2005

    [default: False] [currently: False]

display.date_yearfirst : boolean

 When True, prints and parses dates with the year first, eg 2005/01/20

    [default: False] [currently: False]

display.encoding : str/unicode

Defaults to the detected encoding of the console.

Specifies the encoding to be used for strings returned by to_string,

these are generally strings meant to be displayed on the console.

    [default: UTF-8] [currently: UTF-8]

display.expand_frame_repr : boolean

Whether to print out the full DataFrame repr for wide DataFrames across

multiple lines, `max_columns` is still respected, but the output will

wrap-around across multiple "pages" if its width exceeds `display.width`.

    [default: True] [currently: True]

display.float_format : callable

The callable should accept a floating point number and return

a string with the desired format of the number. This is used

 in some places like SeriesFormatter.

See formats.format.EngFormatter for an example.

    [default: None] [currently: None]

display.height : int

    Deprecated.

    [default: 60] [currently: 60]

    (Deprecated, use `display.max_rows` instead.)

display.large_repr : 'truncate'/'info'

 For DataFrames exceeding max_rows/max_cols, the repr (and HTML repr) can

show a truncated table (the default from 0.13), or switch to the view from

df.info() (the behaviour in earlier versions of pandas).

    [default: truncate] [currently: truncate]

display.latex.escape : bool

This specifies if the to_latex method of a Dataframe uses escapes special

    characters.

method. Valid values: False,True

    [default: True] [currently: True]

display.latex.longtable :bool

This specifies if the to_latex method of a Dataframe uses the longtable

    format.

method. Valid values: False,True

    [default: False] [currently: False]

display.latex.repr : boolean

Whether to produce a latex DataFrame representation for jupyter

    environments that support it.

    (default: False)

    [default: False] [currently: False]

display.line_width : int

    Deprecated.

    [default: 80] [currently: 80]

    (Deprecated, use `display.width` instead.)

display.max_categories : int

This sets the maximum number of categories pandas should output when

printing out a `Categorical` or a Series of dtype "category".

    [default: 8] [currently: 8]

display.max_columns : int

 If max_cols is exceeded, switch to truncate view. Depending on

`large_repr`, objects are either centrally truncated or printed as

a summary view. 'None' value means unlimited.

In case python/IPython is running in a terminal and `large_repr`

 equals 'truncate' this can be set to 0 and pandas will auto-detect

the width of the terminal and print a truncated object which fits

the screen width. The IPython notebook, IPython qtconsole, or IDLE

 do not run in a terminal and hence it is not possible to do

correct auto-detection.

    [default: 20] [currently: 20]

display.max_colwidth : int

The maximum width in characters of a column in the repr of

a pandas data structure. When the column overflows, a "..."

placeholder is embedded in the output.

    [default: 50] [currently: 200]

display.max_info_columns : int

max_info_columns is used in DataFrame.info method to decide if

    per column information will be printed.

    [default: 100] [currently: 100]

display.max_info_rows : int or None

df.info() will usually show null-counts for each column.

 For large frames this can be quite slow. max_info_rows and max_info_cols

limit this null check only to frames with smaller dimensions than

    specified.

    [default: 1690785] [currently: 1690785]

display.max_rows : int

 If max_rows is exceeded, switch to truncate view. Depending on

`large_repr`, objects are either centrally truncated or printed as

a summary view. 'None' value means unlimited.

In case python/IPython is running in a terminal and `large_repr`

 equals 'truncate' this can be set to 0 and pandas will auto-detect

the height of the terminal and print a truncated object which fits

the screen height. The IPython notebook, IPython qtconsole, or

IDLE do not run in a terminal and hence it is not possible to do

correct auto-detection.

    [default: 60] [currently: 60]

display.max_seq_items : int or None

 when pretty-printing a long sequence, no more then `max_seq_items`

will be printed. If items are omitted, they will be denoted by the

addition of "..." to the resulting string.

If set to None, the number of items to be printed is unlimited.

    [default: 100] [currently: 100]

display.memory_usage : bool, string or None

This specifies if the memory usage of a DataFrame should be displayed when

df.info() is called. Valid values True,False,'deep'

    [default: True] [currently: True]

display.mpl_style : bool

Setting this to 'default' will modify the rcParams used by matplotlib

 to give plots a more pleasing visual style by default.

Setting this to None/False restores the values to their initial value.

    [default: None] [currently: None]

display.multi_sparse : boolean

 "sparsify" MultiIndex display (do not display repeated

elements in outer levels within groups)

    [default: True] [currently: True]

display.notebook_repr_html : boolean

 When True, IPython notebook will use html representation for

    pandas objects (if it is available).

    [default: True] [currently: True]

display.pprint_nest_depth : int

Controls the number of nested levels to process when pretty-printing

    [default: 3] [currently: 3]

display.precision : int

Floating point output precision (number of significant digits). This is

    only a suggestion

    [default: 6] [currently: 6]

display.show_dimensions : boolean or 'truncate'

Whether to print out dimensions at the end of DataFrame repr.

 If 'truncate' is specified, only print out the dimensions if the

frame is truncated (e.g. not display all rows and/or columns)

    [default: truncate] [currently: truncate]

display.unicode.ambiguous_as_wide : boolean

Whether to use the Unicode East Asian Width to calculate the display text

    width.

Enabling this may affect to the performance (default: False)

    [default: False] [currently: False]

display.unicode.east_asian_width : boolean

Whether to use the Unicode East Asian Width to calculate the display text

    width.

Enabling this may affect to the performance (default: False)

    [default: False] [currently: False]

display.width : int

Width of the display in characters. In case python/IPython is running in

a terminal this can be set to None and pandas will correctly auto-detect

    the width.

Note that the IPython notebook, IPython qtconsole, or IDLE do not run in a

terminal and hence it is not possible to correctly detect the width.

    [default: 80] [currently: 80]

io.excel.xls.writer : string

The default Excel writer engine for 'xls' files. Available options:

 'xlwt' (the default).

    [default: xlwt] [currently: xlwt]

io.excel.xlsm.writer : string

The default Excel writer engine for 'xlsm' files. Available options:

 'openpyxl' (the default).

    [default: openpyxl] [currently: openpyxl]

io.excel.xlsx.writer : string

The default Excel writer engine for 'xlsx' files. Available options:

 'xlsxwriter' (the default), 'openpyxl'.

    [default: xlsxwriter] [currently: xlsxwriter]

io.hdf.default_format : format

 default format writing format, if None, then

put will default to 'fixed' and append will default to 'table'

    [default: None] [currently: None]

io.hdf.dropna_table : boolean

drop ALL nan rows when appending to a table

    [default: False] [currently: False]

mode.chained_assignment : string

Raise an exception, warn, or no action if trying to use chained assignment,

The default is warn

    [default: warn] [currently: warn]

mode.sim_interactive : boolean

Whether to simulate interactive mode for purposes of testing

    [default: False] [currently: False]

mode.use_inf_as_null : boolean

 True means treat None, NaN, INF, -INF as null (old way),

 False means None and NaN are null, but INF, -INF are not null

    (new way).

    [default: False] [currently: False]

來自 <https://blog.csdn.net/xiaodongxiexie/article/details/70147683>

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末聂宾,一起剝皮案震驚了整個(gè)濱河市诊笤,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌纪他,老刑警劉巖晾匠,帶你破解...
    沈念sama閱讀 218,755評(píng)論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異薪寓,居然都是意外死亡澜共,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,305評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門母谎,熙熙樓的掌柜王于貴愁眉苦臉地迎上來展懈,“玉大人,你說我怎么就攤上這事存崖±淳澹” “怎么了?”我有些...
    開封第一講書人閱讀 165,138評(píng)論 0 355
  • 文/不壞的土叔 我叫張陵供搀,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我胎源,道長(zhǎng),這世上最難降的妖魔是什么涕蚤? 我笑而不...
    開封第一講書人閱讀 58,791評(píng)論 1 295
  • 正文 為了忘掉前任万栅,我火速辦了婚禮,結(jié)果婚禮上烦粒,老公的妹妹穿的比我還像新娘代赁。我一直安慰自己,他們只是感情好芭碍,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,794評(píng)論 6 392
  • 文/花漫 我一把揭開白布豁跑。 她就那樣靜靜地躺著,像睡著了一般艇拍。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上层释,一...
    開封第一講書人閱讀 51,631評(píng)論 1 305
  • 那天快集,我揣著相機(jī)與錄音,去河邊找鬼乖寒。 笑死,一個(gè)胖子當(dāng)著我的面吹牛楣嘁,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播聋溜,決...
    沈念sama閱讀 40,362評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼叭爱,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了买雾?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,264評(píng)論 0 276
  • 序言:老撾萬榮一對(duì)情侶失蹤祝迂,失蹤者是張志新(化名)和其女友劉穎器净,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體纠俭,經(jīng)...
    沈念sama閱讀 45,724評(píng)論 1 315
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡浪慌,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,900評(píng)論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了钓简。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片汹想。...
    茶點(diǎn)故事閱讀 40,040評(píng)論 1 350
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖损话,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情丧枪,我是刑警寧澤庞萍,帶...
    沈念sama閱讀 35,742評(píng)論 5 346
  • 正文 年R本政府宣布,位于F島的核電站屎篱,受9級(jí)特大地震影響服赎,放射性物質(zhì)發(fā)生泄漏交播。R本人自食惡果不足惜践付,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,364評(píng)論 3 330
  • 文/蒙蒙 一永高、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧命爬,春花似錦、人聲如沸饲宛。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,944評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)家淤。三九已至,卻和暖如春絮重,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背青伤。 一陣腳步聲響...
    開封第一講書人閱讀 33,060評(píng)論 1 270
  • 我被黑心中介騙來泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留亮蛔,地道東北人擎厢。 一個(gè)月前我還...
    沈念sama閱讀 48,247評(píng)論 3 371
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像动遭,于是被迫代替她去往敵國(guó)和親芬探。 傳聞我的和親對(duì)象是個(gè)殘疾皇子厘惦,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,979評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容