3
我试图找到“CrudeRate”及其相关的“STATE_NAME”使用下面的代码的最大值:ArcPy中:字典语法错误“无法分配到函数调用”
import arcpy
arcpy.env.workspace = "C:\\"
shp = r"C:\\USCancer2000.dbf"
rows = arcpy.SearchCursor(shp)
CrudeRate= "CrudeRate"
State_name= "State_name"
out_dict = {}
for row in rows:
for C in CrudeRate:
lst = []
if row.CrudeRate == C:
lst.append(row.CrudeRate)
out_dict(C) = max(lst)
del row,rows
for CrudeRate in out_dict:
print CrudeRate, State_name
但是当我运行它,我得到:
Sytnax error: Can't assign function call
有谁看到的问题以及如何解决它?