An open API service indexing awesome lists of open source software.

https://github.com/hansalemaos/dftogithubmarkdown

DataFrame to GitHub markdown table
https://github.com/hansalemaos/dftogithubmarkdown

github markdown

Last synced: 5 months ago
JSON representation

DataFrame to GitHub markdown table

Awesome Lists containing this project

README

          

# A function to convert DataFrames to GitHub markdown

## `pip install dftogithubmarkdown`

```py
from dftogithubmarkdown import to_git_markdown
print(to_git_markdown(df, max_col_width=30, max_rows=-1))
"""
Convert a pandas DataFrame to a GitHub-flavored markdown table string.

Parameters:
df (pd.DataFrame): The DataFrame to convert.
max_col_width (int): Maximum width for each column in the markdown table. Default is 30.
max_rows (int): Maximum number of rows to include in the table. If -1, include all rows.

Returns:
str: A string representing the DataFrame in GitHub-flavored markdown table format.
"""

```