to_string(self, buf: 'FilePath | WriteBuffer[str] | None' = None, columns: 'Sequence[str] | None' = None, col_space: 'int | list[int] | dict[Hashable, int] | None' = None, header: 'bool | Sequence[str]' = True, index: 'bool' = True, na_rep: 'str' = 'NaN', formatters: 'fmt.FormattersType | None' = None, float_format: 'fmt.FloatFormatType | None' = None, sparsify: 'bool | None' = None, index_names: 'bool' = True, justify: 'str | None' = None, max_rows: 'int | None' = None, max_cols: 'int | None' = None, show_dimensions: 'bool' = False, decimal: 'str' = '.', line_width: 'int | None' = None, min_rows: 'int | None' = None, max_colwidth: 'int | None' = None, encoding: 'str | None' = None) -> 'str | None'
Buffer to write to. If None, the output is returned as a string.
The subset of columns to write. Writes all columns by default.
The minimum width of each column. If a list of ints is given every integers corresponds with one column. If a dict is given, the key references the column, while the value defines the space to use..
Write out the column names. If a list of strings is given, it is assumed to be aliases for the column names.
Whether to print index (row) labels.
String representation of NaN
to use.
Formatter functions to apply to columns' elements by position or name. The result of each function must be a unicode string. List/tuple must be of length equal to the number of columns.
Formatter function to apply to columns' elements if they are floats. This function must return a unicode string and will be applied only to the non- NaN
elements, with NaN
being handled by na_rep
.
Set to False for a DataFrame with a hierarchical index to print every multiindex key at each row.
Prints the names of the indexes.
How to justify the column labels. If None uses the option from the print configuration (controlled by set_option), 'right' out of the box. Valid values are
left
right
center
justify
justify-all
start
end
inherit
match-parent
initial
unset.
Maximum number of rows to display in the console.
Maximum number of columns to display in the console.
Display DataFrame dimensions (number of rows by number of columns).
Character recognized as decimal separator, e.g. ',' in Europe.
Width to wrap a line in characters.
The number of rows to display in the console in a truncated repr (when number of rows is above :None:None:`max_rows`
).
Max width to truncate each column in characters. By default, no limit.
Set character encoding.
If buf is None, returns the result as a string. Otherwise returns None.
Render a DataFrame to a console-friendly tabular output.
to_html
Convert DataFrame to HTML.
>>> d = {'col1': [1, 2, 3], 'col2': [4, 5, 6]}See :
... df = pd.DataFrame(d)
... print(df.to_string()) col1 col2 0 1 4 1 2 5 2 3 6
The following pages refer to to this document either explicitly or contain code examples using this.
pandas.io.formats.format.get_dataframe_repr_params
pandas.core.generic.NDFrame.to_latex
pandas.core.frame.DataFrame.to_html
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them