pandas.Series.to_markdown

Series.to_markdown(self, buf: Union[IO[str], NoneType] = None, mode: Union[str, NoneType] = None, **kwargs) → Union[str, NoneType][source]

Print Series in Markdown-friendly format.

New in version 1.0.0.

Parameters
bufwritable buffer, defaults to sys.stdout

Where to send the output. By default, the output is printed to sys.stdout. Pass a writable buffer if you need to further process the output.

modestr, optional

Mode in which file is opened.

**kwargs

These parameters will be passed to tabulate.

Returns
str

Series in Markdown-friendly format.

Examples

>>> s = pd.Series(["elk", "pig", "dog", "quetzal"], name="animal")
>>> print(s.to_markdown())
|    | animal   |
|---:|:---------|
|  0 | elk      |
|  1 | pig      |
|  2 | dog      |
|  3 | quetzal  |