pandas.DataFrame.to_markdown

pandas 3.1.1 · DataFrame · method

Render a table as Markdown text.

Call syntax

DataFrame.to_markdown(buf=None, *, mode='wt', index=True, storage_options=None, **kwargs)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
buf Optional
Positional or keyword
Default None
str, Path or StringIO-like

Supply a destination file-like buffer, or use the default to return or print the output as documented.

mode Optional
Keyword only
Default 'wt'
str

Choose a file or storage access mode.

index Optional
Keyword only
Default True
bool

Supply row labels or control how existing row labels are used.

storage_options Optional
Keyword only
Default None
dict

Pass storage-backend options such as connection settings or HTTP headers.

**kwargs Optional
Additional keyword arguments

Returns

Text when no output destination is supplied. A write to a path or buffer returns None.