I want to compare the changes in geometry between two shapefiles (of election districts in NYC. One is from 2001 and the other 2005). I am attempting to calculate a new field in the 2005 shapefile that shows the change in AREA from the 2001 shapefile to the 2005 shapefile, using the districts common IDs.
What I can't seem to figure out is how to refer to a field name in ANOTHER shapefile in my field calculator definition.
Here's what I have so far:
Pre-Logic Script Code:
def areaChg(shpOrig, areaOrig, shpNew, areaNew): origRows = arcpy.SearchCursor(shpOrig) for origRow in origRows: newRows = arcpy.SearchCursor(shpNew) for newRow in newRows: if origRow.ED == newRow.ED: return newRow.ED - origRow.ED else: pass
areaChg("nyed_01bav", areaOrig, "nyed_05", !Area!)
It's the "areaOrig" in that last part of code, which is the place-holder for the field in the other shapefile, which I'm having a hard time with. How do I point to a field in another shapefile in field calculator? For the field in the shapefile from within which I'm doing the calculation, the correct format is "!Area!", but what about for a field from another shapefile?