Categorizing foods

Question

You are given the following dataframe and are asked to categorize each food into 1 of 3 categories: meat, fruit, or other.

food pounds
0 bacon 4.0
1 STRAWBERRIES 3.5
2 Bacon 7.0
3 STRAWBERRIES 3.0
4 BACON 6.0
5 strawberries 9.0
6 Strawberries 1.0
7 pecans 3.0

Given this, write code to add a new column categorizing each row.

Solution

Access restricted

Subscribe to premium account to see the solution.

Get premium now