I have three columns, one for percentage White, percentage Hispanic, and percentage African American per census tract. I'm trying to use Python to extract the population subtype with the highest percentage into a new column called "highest_percentage". The highest percentage category will have 3 classes: 1,2, and 3. I can not figure out how to set a conditional statement so that I can automatically assign a value of 1,2, or 3 to the census tract to use in a classified map.
I was able to write code to find the highest percentage and assign the new field the same value as that percentage, but i'm trying to find which field has the highest value and assign it 1-3 based on a classification. 3 white, 2 Hispanic, 1 African American
I've attached a screenshot of the table and the code window below.