Series.
to_markdown
Print Series or DataFrame in Markdown-friendly format.
Note
This method should only be used if the resulting pandas object is expected to be small, as all the data is loaded into the driver’s memory.
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.
Mode in which file is opened.
These parameters will be passed to tabulate.
Series or DataFrame in Markdown-friendly format.
Notes
Requires the tabulate package.
Examples
>>> psser = ps.Series(["elk", "pig", "dog", "quetzal"], name="animal") >>> print(psser.to_markdown()) | | animal | |---:|:---------| | 0 | elk | | 1 | pig | | 2 | dog | | 3 | quetzal |
>>> psdf = ps.DataFrame( ... data={"animal_1": ["elk", "pig"], "animal_2": ["dog", "quetzal"]} ... ) >>> print(psdf.to_markdown()) | | animal_1 | animal_2 | |---:|:-----------|:-----------| | 0 | elk | dog | | 1 | pig | quetzal |