我正在尝试使用以下代码找到“CrudeRate”的最大值及其关联的“State_name”:
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
但是当我运行它时,我得到:
语法错误:无法分配函数调用
有没有人看到问题以及如何解决它?