I am attempting to write the code for a toll in Python that will effectively:
import arcpy as ARCPYdef medianCalculation(): mxd = ARCPY.mapping.MapDocument("CURRENT") df = ARCPY.mapping.ListDataFrames (mxd) [0] country = ARCPY.GetParameter(0) countryCursor = ARCPY.da.SearchCursor("cities", ["CNTRY_NAME", "POP_RANK"]) POPDict = {} for country in countryCursor:
أكثر...
- access the city data and load it, if it isn't already in the list of layers
- get a country name from the user and access just the cities inside that country
- calculate the median POP_RANK of all cities in that country and report the median to the user
import arcpy as ARCPYdef medianCalculation(): mxd = ARCPY.mapping.MapDocument("CURRENT") df = ARCPY.mapping.ListDataFrames (mxd) [0] country = ARCPY.GetParameter(0) countryCursor = ARCPY.da.SearchCursor("cities", ["CNTRY_NAME", "POP_RANK"]) POPDict = {} for country in countryCursor:
أكثر...