I'm trying to reclass values in field calculator using Python (recreating something I did successfully last month and am failing now). I've reviewed many questions and answers on this site with no success.
I've followed multiple examples from ArcGIS help and on this site, and regardless of how I change my statements, the calculator returns only one answer for all records. I added a picture as an example.
I wrote the following pre-logic script code, but the calculator returns "1" for all data. I have a field (Percent) of percentages and I'd like to bin them into 5 groups in the cate field: greater than or equal to 80; greater than or equal to 60 and less than 80; greater than or equal to 40 and less than 60; greater than or equal to 20 and less than 40; greater than or equal to 0 and less than 20.
I have no python experience and am just trying to replicate examples from GIS help and answers to similar questions on this site.
def Reclass(Percent): if Percent >= 80: return 5 elif Percent >= 60 and Percent < 80: return 4 elif Percent >= 40 and Percent < 60: return 3 elif Percent >= 20 and Percent < 40: return 2 elif Percent >= 0 and Percent < 20: return 1