Skip to content

Instantly share code, notes, and snippets.

@lauramsfernandes
Created May 30, 2021 15:44
Show Gist options
  • Save lauramsfernandes/e31d602558e605a984eda44e8a7c9978 to your computer and use it in GitHub Desktop.
Save lauramsfernandes/e31d602558e605a984eda44e8a7c9978 to your computer and use it in GitHub Desktop.
length_mapping ={'Short' : 1,
'Medium': 2,
'Long' : 3}
df['Length'] = df['Length'].map(length_mapping)
df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment