pandas.io.formats.style.Styler.to_string
pandas 3.1.1 · Styling · method
Return a human-readable textual representation or write it to the supplied buffer.
Call syntax
Styler.to_string(…) Full signature
Styler.to_string(
buf=None,
*,
encoding=None,
sparse_index=None,
sparse_columns=None,
max_rows=None,
max_columns=None,
delimiter=' ',
)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
buf |
Optional Positional or keyword Default None |
str, path object, file-like object Supply a destination file-like buffer, or use the default to return or print the output as documented. |
encoding |
Optional Keyword only Default None |
str Name a text encoding such as "utf-8". |
sparse_index |
Optional Keyword only Default None |
bool |
sparse_columns |
Optional Keyword only Default None |
bool |
max_rows |
Optional Keyword only Default None |
int |
max_columns |
Optional Keyword only Default None |
int |
delimiter |
Optional Keyword only Default ' ' |
str |
Returns
str or None