Created
September 7, 2020 18:45
-
-
Save YiLi225/a9b26e049a86562464da820a6ecd6ed1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Caveat: (1) less flexible regarding assigning new values | |
dairy_table['Food_Category'] = dairy_table['Food_Category'].astype('category') | |
dairy_table['Food_Category'].iloc[2] = 'Another_Category' | |
In [112]: ValueError: Cannot setitem on a Categorical with a new category, set the categories first |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment