Skip to content

Instantly share code, notes, and snippets.

@yinleon
Last active March 11, 2021 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yinleon/3488416c26effc8a9f8fb6bdb61a59f4 to your computer and use it in GitHub Desktop.
Save yinleon/3488416c26effc8a9f8fb6bdb61a59f4 to your computer and use it in GitHub Desktop.
A simple script to make a Markdown table for a data dictionary (assumes you just have a column name and description).
"""
A simple script to make a Markdown table for a data dictionary (assumes you just have a column name and description).
"""
import pandas as pd
col2description = {
"Name": "What you can call me",
"Id": "The identifier",
"Nickname": "Do you have to ask?"
}
series = pd.Series(col2description, name='description')
series = series.rename_axis('column')
print(series.to_markdown())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment