Could someone tell me how to classify/populate fields with QGIS FieldPyculator Plugin?
In the Attribute Table, I have a field named POPULACAO with population data:
I want to apply a weight to classify these fields. I've installed QGIS FieldPyculator Plugin via repository. Below the Python code to complete this task in ArcGIS 10:
def reclass(POP): if (POP <= 10000): return 1 elif (POP > 10001 and POP <= 30000): return 2 elif (POP > 30001 and POP <= 50000): return 3 elif (POP > 50001 and POP <= 100000): return 4 elif (POP > 100001 and POP <= 200000): return 5 elif (POP > 200001 and POP <= 500000): return 6 elif (POP > 500001 and POP <= 1000000): return 7 else: return 8
In the box below:
reclass( !POPULACAO! )
The ArcGIS 10 Python code works like a charm. Data shapefile: http://bit.ly/xBW8Pz | In FieldPyculator, I did wrong, I know:
Please help me. Jorge Santos