DataFrame.
to_markdown
Print DataFrame in Markdown-friendly format.
New in version 1.0.0.
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.
DataFrame in Markdown-friendly format.
Examples
>>> df = pd.DataFrame( ... data={"animal_1": ["elk", "pig"], "animal_2": ["dog", "quetzal"]} ... ) >>> print(df.to_markdown()) | | animal_1 | animal_2 | |---:|:-----------|:-----------| | 0 | elk | dog | | 1 | pig | quetzal |