ormats.style.Styler.set_properties.html)
    * [ pandas.io.formats.style.Styler.set_uuid ](pandas.io.formats.style.Styler.set_uuid.html)
    * [ pandas.io.formats.style.Styler.clear ](pandas.io.formats.style.Styler.clear.html)
    * [ pandas.io.formats.style.Styler.pipe ](pandas.io.formats.style.Styler.pipe.html)
    * [ pandas.io.formats.style.Styler.highlight_null ](pandas.io.formats.style.Styler.highlight_null.html)
    * [ pandas.io.formats.style.Styler.highlight_max ](pandas.io.formats.style.Styler.highlight_max.html)
    * [ pandas.io.formats.style.Styler.highlight_min ](pandas.io.formats.style.Styler.highlight_min.html)
    * [ pandas.io.formats.style.Styler.highlight_between ](pandas.io.formats.style.Styler.highlight_between.html)
    * [ pandas.io.formats.style.Styler.highlight_quantile ](pandas.io.formats.style.Styler.highlight_quantile.html)
    * [ pandas.io.formats.style.Styler.background_gradient ](pandas.io.formats.style.Styler.background_gradient.html)
    * [ pandas.io.formats.style.Styler.text_gradient ](pandas.io.formats.style.Styler.text_gradient.html)
    * [ pandas.io.formats.style.Styler.bar ](pandas.io.formats.style.Styler.bar.html)
    * [ pandas.io.formats.style.Styler.to_html ](pandas.io.formats.style.Styler.to_html.html)
    * [ pandas.io.formats.style.Styler.to_latex ](pandas.io.formats.style.Styler.to_latex.html)
    * [ pandas.io.formats.style.Styler.to_excel ](pandas.io.formats.style.Styler.to_excel.html)
    * pandas.io.formats.style.Styler.to_string 
    * [ pandas.io.formats.style.Styler.export ](pandas.io.formats.style.Styler.export.html)
    * [ pandas.io.formats.style.Styler.use ](pandas.io.formats.style.Styler.use.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ Style ](../style.html)
  * pandas.io.fo... 

#  pandas.io.formats.style.Styler.to_string  #

Styler.  to_string  (  _ buf  =  None  _ , _ *  _ , _ encoding  =  None  _ , _
sparse_index  =  None  _ , _ sparse_columns  =  None  _ , _ max_rows  =  None
_ , _ max_columns  =  None  _ , _ delimiter  =  '  '  _ )  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/io/formats/style.py#L1388-L1457) #

    

Write Styler to a file, buffer or string in text format.

New in version 1.5.0.

Parameters  :

    

**buf** str, path object, file-like object, optional

    

String, path object (implementing ` os.PathLike[str]  ` ), or file-like object
implementing a string ` write()  ` function. If ` None  ` , the result is
returned as a string.

**encoding** str, optional

    

Character encoding setting for file output (and meta tags if available).
Defaults to ` pandas.options.styler.render.encoding  ` value of âutf-8â.

**sparse_index** bool, optional

    

Whether to sparsify the display of a hierarchical index. Setting to False will
display each explicit level element in a hierarchical key for each row.
Defaults to ` pandas.options.styler.sparse.index  ` value.

**sparse_columns** bool, optional

    

Whether to sparsify the display of a hierarchical index. Setting to False will
display each explicit level element in a hierarchical key for each column.
Defaults to ` pandas.options.styler.sparse.columns  ` value.

**max_rows** int, optional

    

The maximum number of rows that will be rendered. Defaults to `
pandas.options.styler.render.max_rows  ` , which is None.

**max_columns** int, optional

    

The maximum number of columns that will be rendered. Defaults to `
pandas.options.styler.render.max_columns  ` , which is None.

Rows and columns may be reduced if the number of total elements is large. This
value is set to ` pandas.options.styler.render.max_elements  ` , which is
262144 (18 bit browser rendering).

**delimiter** str, default single space

    

The separator between data elem