to_string

The to_string method returns the first n rows of a table as a pipe-delimited string.

Syntax

Parameters

ParameterTypeDescription
num_rowsint

The number of rows from the beginning of the table to return. Default is 10.

cols optionalUnion[str, Sequence[str]]

The columns name(s) to include in the string. Default is None, which includes all columns.

Returns

A pipe-delimited string containing the first n rows of the table.

Example