小编Dav*_*eek的帖子

Arcpy:字典语法错误"无法分配给函数调用"

我正在尝试使用以下代码找到"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
Run Code Online (Sandbox Code Playgroud)

但当我运行它时,我得到:

Sytnax错误:无法分配函数调用

有没有人看到问题以及如何解决它?

python arcpy

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

arcpy ×1

python ×1