Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
## Correct way to set new category values ##
dairy_table['Food_Category'] = dairy_table['Food_Category'].cat.add_categories(['Another_Category'])
dairy_table['Food_Category'].iloc[2] = 'Another_Category'
index0 Milk
index1 others
index2 Another_Category
index3 Milk
index4 Milk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment