Skip to content

Instantly share code, notes, and snippets.

@erraticgenerator
Created October 31, 2020 20:30
Show Gist options
  • Save erraticgenerator/edd1a23f814d5717f2eca8b8d83e868e to your computer and use it in GitHub Desktop.
Save erraticgenerator/edd1a23f814d5717f2eca8b8d83e868e to your computer and use it in GitHub Desktop.
col_names = {
"100": "thin",
"100italic": "thinitalic",
"200": "extralight",
"200italic": "extralightitalic",
"300": "light",
"300italic": "lightitalic",
"400": "regular",
"regular": "regular",
"400italic": "italic",
"italic": "italic",
"500": "medium",
"500italic": "mediumitalic",
"600": "semibold",
"600italic": "semibolditalic",
"700": "bold",
"700italic": "bolditalic",
"800": "extrabold",
"800italic": "extrabolditalic",
"900": "black",
"900italic": "blackitalic"
}
col_names = {k:f'variants_{v}' for k, v in col_names.items()}
df = df.rename(col_names, axis='columns')
df.columns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment