Skip to main content
added 442 characters in body
Source Link
GIS_GOD
  • 399
  • 1
  • 13

I'm getting the following error "Type Error: 'dict' object is not callable", with the code below:

import arcpy

def printDict(dictionary, printCount=False):
    for key in dictionary:
        arcpy.AddMessage(key + ": " + dictionary[key])
    if printCount is True:
        arcpy.AddMessage(str(len(dictionary)))

pld3GDB = 'C:\\Users\\bro81520\\Documents\\ArcGIS\\PLDV3_SPC_ODN_315_25Sep\\PLDV3_SPC_ODN_315_25Sep.gdb\\WO_HIERARCHY'
fdaAREA = 'C:\\Users\\bro81520\\Documents\\ArcGIS\\Default.gdb\\FDA_AREA'

d = dict()  # VENDOR_WO_ID : NFID

fields1 = ['VENDOR_WO_ID', 'NFID', 'ISFDA'] 
with arcpy.da.SearchCursor(pld3GDB, fields1) as cursor:
    for row in cursor:
        if row[2] == "Y":
            d[row[0]] = row[1]

# print dictionary
printDict(d, printCount=True)

fields2 = ['bv_workorderid', 'bv_nfid']
with arcpy.da.UpdateCursor(fdaAREA, fields2) as cursor:
    for row in cursor:
        if row[0] in d:
            row[1] = d[row[0]]
            cursor.updateRow(row)           

I've looked at the following resources, but haven't deciphered exactly what is wrong: https://stackoverflow.com/questions/41605525/typeerror-dict-object-is-not-callable-while-using-dict

https://gis.stackexchange.com/questions/198770/creating-a-dict-with-search-cursor

I'm getting the following error "Type Error: 'dict' object is not callable", with the code below:

d = dict()  # VENDOR_WO_ID : NFID

fields1 = ['VENDOR_WO_ID', 'NFID', 'ISFDA'] 
with arcpy.da.SearchCursor(pld3GDB, fields1) as cursor:
    for row in cursor:
        if row[2] == "Y":
            d[row[0]] = row[1]

# print dictionary
printDict(d, printCount=True)

fields2 = ['bv_workorderid', 'bv_nfid']
with arcpy.da.UpdateCursor(fdaAREA, fields2) as cursor:
    for row in cursor:
        if row[0] in d:
            row[1] = d[row[0]]
            cursor.updateRow(row)           

I've looked at the following resources, but haven't deciphered exactly what is wrong: https://stackoverflow.com/questions/41605525/typeerror-dict-object-is-not-callable-while-using-dict

https://gis.stackexchange.com/questions/198770/creating-a-dict-with-search-cursor

I'm getting the following error "Type Error: 'dict' object is not callable", with the code below:

import arcpy

def printDict(dictionary, printCount=False):
    for key in dictionary:
        arcpy.AddMessage(key + ": " + dictionary[key])
    if printCount is True:
        arcpy.AddMessage(str(len(dictionary)))

pld3GDB = 'C:\\Users\\bro81520\\Documents\\ArcGIS\\PLDV3_SPC_ODN_315_25Sep\\PLDV3_SPC_ODN_315_25Sep.gdb\\WO_HIERARCHY'
fdaAREA = 'C:\\Users\\bro81520\\Documents\\ArcGIS\\Default.gdb\\FDA_AREA'

d = dict()  # VENDOR_WO_ID : NFID

fields1 = ['VENDOR_WO_ID', 'NFID', 'ISFDA'] 
with arcpy.da.SearchCursor(pld3GDB, fields1) as cursor:
    for row in cursor:
        if row[2] == "Y":
            d[row[0]] = row[1]

# print dictionary
printDict(d, printCount=True)

fields2 = ['bv_workorderid', 'bv_nfid']
with arcpy.da.UpdateCursor(fdaAREA, fields2) as cursor:
    for row in cursor:
        if row[0] in d:
            row[1] = d[row[0]]
            cursor.updateRow(row)           

I've looked at the following resources, but haven't deciphered exactly what is wrong: https://stackoverflow.com/questions/41605525/typeerror-dict-object-is-not-callable-while-using-dict

https://gis.stackexchange.com/questions/198770/creating-a-dict-with-search-cursor

removed help appreciation
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

I'm getting the following error "Type Error: 'dict' object is not callable", with the code below:

d = dict()  # VENDOR_WO_ID : NFID

fields1 = ['VENDOR_WO_ID', 'NFID', 'ISFDA'] 
with arcpy.da.SearchCursor(pld3GDB, fields1) as cursor:
    for row in cursor:
        if row[2] == "Y":
            d[row[0]] = row[1]

# print dictionary
printDict(d, printCount=True)

fields2 = ['bv_workorderid', 'bv_nfid']
with arcpy.da.UpdateCursor(fdaAREA, fields2) as cursor:
    for row in cursor:
        if row[0] in d:
            row[1] = d[row[0]]
            cursor.updateRow(row)           

I've looked at the following resources, but haven't deciphered exactly what is wrong: https://stackoverflow.com/questions/41605525/typeerror-dict-object-is-not-callable-while-using-dict

https://gis.stackexchange.com/questions/198770/creating-a-dict-with-search-cursor

Any help in the matter would be greatly appreciated.

I'm getting the following error "Type Error: 'dict' object is not callable", with the code below:

d = dict()  # VENDOR_WO_ID : NFID

fields1 = ['VENDOR_WO_ID', 'NFID', 'ISFDA'] 
with arcpy.da.SearchCursor(pld3GDB, fields1) as cursor:
    for row in cursor:
        if row[2] == "Y":
            d[row[0]] = row[1]

# print dictionary
printDict(d, printCount=True)

fields2 = ['bv_workorderid', 'bv_nfid']
with arcpy.da.UpdateCursor(fdaAREA, fields2) as cursor:
    for row in cursor:
        if row[0] in d:
            row[1] = d[row[0]]
            cursor.updateRow(row)           

I've looked at the following resources, but haven't deciphered exactly what is wrong: https://stackoverflow.com/questions/41605525/typeerror-dict-object-is-not-callable-while-using-dict

https://gis.stackexchange.com/questions/198770/creating-a-dict-with-search-cursor

Any help in the matter would be greatly appreciated.

I'm getting the following error "Type Error: 'dict' object is not callable", with the code below:

d = dict()  # VENDOR_WO_ID : NFID

fields1 = ['VENDOR_WO_ID', 'NFID', 'ISFDA'] 
with arcpy.da.SearchCursor(pld3GDB, fields1) as cursor:
    for row in cursor:
        if row[2] == "Y":
            d[row[0]] = row[1]

# print dictionary
printDict(d, printCount=True)

fields2 = ['bv_workorderid', 'bv_nfid']
with arcpy.da.UpdateCursor(fdaAREA, fields2) as cursor:
    for row in cursor:
        if row[0] in d:
            row[1] = d[row[0]]
            cursor.updateRow(row)           

I've looked at the following resources, but haven't deciphered exactly what is wrong: https://stackoverflow.com/questions/41605525/typeerror-dict-object-is-not-callable-while-using-dict

https://gis.stackexchange.com/questions/198770/creating-a-dict-with-search-cursor

edited body
Source Link
GIS_GOD
  • 399
  • 1
  • 13

I'm getting the following error "Type Error: 'dict' object is not callable", with the code below:

d = dict()  # VENDOR_WO_ID : NFID

fields1 = ['VENDOR_WO_ID', 'NFID', 'ISFDA'] 
with arcpy.da.SearchCursor(pld3GDB, fields1) as cursor:
    for row in cursor:
        if row[2] == "Y":
            d[row[0]] = row[1]

# print dictionary
printDict(d, printCount=True)

fields2 = ['bv_workorderid', 'bv_nfid']
with arcpy.da.UpdateCursor(fdaAREA, fields2) as cursor:
    for row in cursor:
        if row[0] in d:
            row[1] = d[row[0]]
            cursor.updateRow(row)           

I've looked at the following resources, but haven't deciphered what exactly what is wrong: https://stackoverflow.com/questions/41605525/typeerror-dict-object-is-not-callable-while-using-dict

https://gis.stackexchange.com/questions/198770/creating-a-dict-with-search-cursor

Any help in the matter would be greatly appreciated.

I'm getting the following error "Type Error: 'dict' object is not callable", with the code below:

d = dict()  # VENDOR_WO_ID : NFID

fields1 = ['VENDOR_WO_ID', 'NFID', 'ISFDA'] 
with arcpy.da.SearchCursor(pld3GDB, fields1) as cursor:
    for row in cursor:
        if row[2] == "Y":
            d[row[0]] = row[1]

# print dictionary
printDict(d, printCount=True)

fields2 = ['bv_workorderid', 'bv_nfid']
with arcpy.da.UpdateCursor(fdaAREA, fields2) as cursor:
    for row in cursor:
        if row[0] in d:
            row[1] = d[row[0]]
            cursor.updateRow(row)           

I've looked at the following resources, but haven't deciphered what exactly is wrong: https://stackoverflow.com/questions/41605525/typeerror-dict-object-is-not-callable-while-using-dict

https://gis.stackexchange.com/questions/198770/creating-a-dict-with-search-cursor

Any help in the matter would be greatly appreciated.

I'm getting the following error "Type Error: 'dict' object is not callable", with the code below:

d = dict()  # VENDOR_WO_ID : NFID

fields1 = ['VENDOR_WO_ID', 'NFID', 'ISFDA'] 
with arcpy.da.SearchCursor(pld3GDB, fields1) as cursor:
    for row in cursor:
        if row[2] == "Y":
            d[row[0]] = row[1]

# print dictionary
printDict(d, printCount=True)

fields2 = ['bv_workorderid', 'bv_nfid']
with arcpy.da.UpdateCursor(fdaAREA, fields2) as cursor:
    for row in cursor:
        if row[0] in d:
            row[1] = d[row[0]]
            cursor.updateRow(row)           

I've looked at the following resources, but haven't deciphered exactly what is wrong: https://stackoverflow.com/questions/41605525/typeerror-dict-object-is-not-callable-while-using-dict

https://gis.stackexchange.com/questions/198770/creating-a-dict-with-search-cursor

Any help in the matter would be greatly appreciated.

Source Link
GIS_GOD
  • 399
  • 1
  • 13
Loading