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

I'm trying to check the "fiberEquipment" table against the "material_cd" table and find instances where there are discrepancies. E.G -- Checking that "material_cd" 10785823 in "fiberEquipment" has all the correct values associated with it (inputportcount, outputportcount, inputblockcount, etc.) per the "material_cd" table.

enter image description here

The code I'm using below takes the values from the "fiberEquipment" table, inserts them into a dictionary and than uses a search cursor invoking the dictionary elements to check for discrepancies. The code currently works without any errors, but the logic seems to be flawed, as it's not doing anything when all fields match.

# Fiber Equipment/Material Catalog fields
matcd_fields = ["material_cd"]["material_cd", "inputportcount"]
fibequip_fields = ["material_cd", "inputportcount", "outputportcount", "inputblockcount", "outputblockcount", "objectid"]
       
# Compare FIBEREQUIPMENT table to Material Catalog table and determine which objectid's have records that aren't matching
 ipc = {} # 'material_cd' : 'inputportcount'
 ipcOID = {} # 'material_cd' : 'objectid'
 opc = {} # 'material_cd' : 'outputportcount'
 opcOID = {} # 'material_cd' : 'objectid'
 ibc = {} # 'material_cd' : 'inputblockcount'
 ibcOID = {} # 'material_cd' : 'objectid'
 obc = {} # 'material_cd' : 'outputblockcount'
 obcOID = {} # 'material_cd' : 'objectid'

with arcpy.da.SearchCursor(fiberEquipment, fibequip_fields) as cursor:
    for row in cursor:
        ipc[str(row[0])] = row[1]
        ipcOID[str(row[0])] = row[5]
        opc[str(row[0])] = row[2]
        ipcOID[str(row[0])] = row[5]
        ibc[str(row[0])] = row[3]
        ibcOID[str(row[0])] = row[5]
        obc[str(row[0])] = row[4]
        obcOID[str(row[0])] = row[5]

objectID = []

with arcpy.da.SearchCursor(material_catalog, matcd_fields) as cursor:
    for row in cursor:
        if ipc[str(row[1])] == row[1]:
             objectID.append(ipcOID[row[0]])

I'm trying to check the "fiberEquipment" table against the "material_cd" table and find instances where there are discrepancies. E.G -- Checking that "material_cd" 10785823 in "fiberEquipment" has all the correct values associated with it (inputportcount, outputportcount, inputblockcount, etc.) per the "material_cd" table.

enter image description here

The code I'm using below takes the values from the "fiberEquipment" table, inserts them into a dictionary and than uses a search cursor invoking the dictionary elements to check for discrepancies. The code currently works without any errors, but the logic seems to be flawed, as it's not doing anything when all fields match.

# Fiber Equipment/Material Catalog fields
matcd_fields = ["material_cd"]
fibequip_fields = ["material_cd", "inputportcount", "outputportcount", "inputblockcount", "outputblockcount", "objectid"]
       
# Compare FIBEREQUIPMENT table to Material Catalog table and determine which objectid's have records that aren't matching
 ipc = {} # 'material_cd' : 'inputportcount'
 ipcOID = {} # 'material_cd' : 'objectid'
 opc = {} # 'material_cd' : 'outputportcount'
 opcOID = {} # 'material_cd' : 'objectid'
 ibc = {} # 'material_cd' : 'inputblockcount'
 ibcOID = {} # 'material_cd' : 'objectid'
 obc = {} # 'material_cd' : 'outputblockcount'
 obcOID = {} # 'material_cd' : 'objectid'

with arcpy.da.SearchCursor(fiberEquipment, fibequip_fields) as cursor:
    for row in cursor:
        ipc[str(row[0])] = row[1]
        ipcOID[str(row[0])] = row[5]
        opc[str(row[0])] = row[2]
        ipcOID[str(row[0])] = row[5]
        ibc[str(row[0])] = row[3]
        ibcOID[str(row[0])] = row[5]
        obc[str(row[0])] = row[4]
        obcOID[str(row[0])] = row[5]

objectID = []

with arcpy.da.SearchCursor(material_catalog, matcd_fields) as cursor:
    for row in cursor:
        if ipc[str(row[1])] == row[1]:
             objectID.append(ipcOID[row[0]])

I'm trying to check the "fiberEquipment" table against the "material_cd" table and find instances where there are discrepancies. E.G -- Checking that "material_cd" 10785823 in "fiberEquipment" has all the correct values associated with it (inputportcount, outputportcount, inputblockcount, etc.) per the "material_cd" table.

enter image description here

The code I'm using below takes the values from the "fiberEquipment" table, inserts them into a dictionary and than uses a search cursor invoking the dictionary elements to check for discrepancies. The code currently works without any errors, but the logic seems to be flawed, as it's not doing anything when all fields match.

# Fiber Equipment/Material Catalog fields
matcd_fields = ["material_cd", "inputportcount"]
fibequip_fields = ["material_cd", "inputportcount", "outputportcount", "inputblockcount", "outputblockcount", "objectid"]
       
# Compare FIBEREQUIPMENT table to Material Catalog table and determine which objectid's have records that aren't matching
 ipc = {} # 'material_cd' : 'inputportcount'
 ipcOID = {} # 'material_cd' : 'objectid'
 opc = {} # 'material_cd' : 'outputportcount'
 opcOID = {} # 'material_cd' : 'objectid'
 ibc = {} # 'material_cd' : 'inputblockcount'
 ibcOID = {} # 'material_cd' : 'objectid'
 obc = {} # 'material_cd' : 'outputblockcount'
 obcOID = {} # 'material_cd' : 'objectid'

with arcpy.da.SearchCursor(fiberEquipment, fibequip_fields) as cursor:
    for row in cursor:
        ipc[str(row[0])] = row[1]
        ipcOID[str(row[0])] = row[5]
        opc[str(row[0])] = row[2]
        ipcOID[str(row[0])] = row[5]
        ibc[str(row[0])] = row[3]
        ibcOID[str(row[0])] = row[5]
        obc[str(row[0])] = row[4]
        obcOID[str(row[0])] = row[5]

objectID = []

with arcpy.da.SearchCursor(material_catalog, matcd_fields) as cursor:
    for row in cursor:
        if ipc[str(row[1])] == row[1]:
             objectID.append(ipcOID[row[0]])
added 152 characters in body
Source Link
GIS_GOD
  • 399
  • 1
  • 13

I'm trying to check the "fiberEquipment" table against the "material_cd" table and find instances where there are discrepancies. E.G -- Checking that "material_cd" 10785823 in "fiberEquipment" has all the correct values associated with it (inputportcount, outputportcount, inputblockcount, etc.) per the "material_cd" table.

enter image description here

The code I'm using below takes the values from the "fiberEquipment" table, inserts them into a dictionary and than uses a search cursor invoking the dictionary elements to check for discrepancies. The code currently works without any errors, but the logic seems to be flawed, as it's not doing anything when all fields match.

# Fiber Equipment/Material Catalog fields
matcd_fields = ["material_cd"]
fibequip_fields = ["material_cd", "inputportcount", "outputportcount", "inputblockcount", "outputblockcount", "objectid"]
       
# Compare FIBEREQUIPMENT table to Material Catalog table and determine which objectid's have records that aren't matching
 ipc = {} # 'material_cd' : 'inputportcount'
 ipcOID = {} # 'material_cd' : 'objectid'
 opc = {} # 'material_cd' : 'outputportcount'
 opcOID = {} # 'material_cd' : 'objectid'
 ibc = {} # 'material_cd' : 'inputblockcount'
 ibcOID = {} # 'material_cd' : 'objectid'
 obc = {} # 'material_cd' : 'outputblockcount'
 obcOID = {} # 'material_cd' : 'objectid'

with arcpy.da.SearchCursor(fiberEquipment, fibequip_fields) as cursor:
    for row in cursor:
        ipc[str(row[0])] = row[1]
        ipcOID[str(row[0])] = row[5]
        opc[str(row[0])] = row[2]
        ipcOID[str(row[0])] = row[5]
        ibc[str(row[0])] = row[3]
        ibcOID[str(row[0])] = row[5]
        obc[str(row[0])] = row[4]
        obcOID[str(row[0])] = row[5]

objectID = []

with arcpy.da.SearchCursor(material_catalog, matcd_fields) as cursor:
    for row in cursor:
        if ipc[str(row[1])] == row[1]:
             objectID.append(ipcOID[row[0]])

I'm trying to check the "fiberEquipment" table against the "material_cd" table and find instances where there are discrepancies. E.G -- Checking that "material_cd" 10785823 in "fiberEquipment" has all the correct values associated with it (inputportcount, outputportcount, inputblockcount, etc.) per the "material_cd" table.

enter image description here

The code I'm using below takes the values from the "fiberEquipment" table, inserts them into a dictionary and than uses a search cursor invoking the dictionary elements to check for discrepancies. The code currently works without any errors, but the logic seems to be flawed, as it's not doing anything when all fields match.

# Fiber Equipment/Material Catalog fields
matcd_fields = ["material_cd"]
fibequip_fields = ["material_cd", "inputportcount", "outputportcount", "inputblockcount", "outputblockcount", "objectid"]
       
# Compare FIBEREQUIPMENT table to Material Catalog table and determine which objectid's have records that aren't matching
ipc = {} # 'material_cd' : 'inputportcount'
opc = {} # 'material_cd' : 'outputportcount'
ibc = {} # 'material_cd' : 'inputblockcount'
obc = {} # 'material_cd' : 'outputblockcount'

with arcpy.da.SearchCursor(fiberEquipment, fibequip_fields) as cursor:
    for row in cursor:
        ipc[str(row[0])] = row[1]
        ipcOID[str(row[0])] = row[5]
        opc[str(row[0])] = row[2]
        ipcOID[str(row[0])] = row[5]
        ibc[str(row[0])] = row[3]
        ibcOID[str(row[0])] = row[5]
        obc[str(row[0])] = row[4]
        obcOID[str(row[0])] = row[5]

objectID = []

with arcpy.da.SearchCursor(material_catalog, matcd_fields) as cursor:
    for row in cursor:
        if ipc[str(row[1])] == row[1]:
             objectID.append(ipcOID[row[0]])

I'm trying to check the "fiberEquipment" table against the "material_cd" table and find instances where there are discrepancies. E.G -- Checking that "material_cd" 10785823 in "fiberEquipment" has all the correct values associated with it (inputportcount, outputportcount, inputblockcount, etc.) per the "material_cd" table.

enter image description here

The code I'm using below takes the values from the "fiberEquipment" table, inserts them into a dictionary and than uses a search cursor invoking the dictionary elements to check for discrepancies. The code currently works without any errors, but the logic seems to be flawed, as it's not doing anything when all fields match.

# Fiber Equipment/Material Catalog fields
matcd_fields = ["material_cd"]
fibequip_fields = ["material_cd", "inputportcount", "outputportcount", "inputblockcount", "outputblockcount", "objectid"]
       
# Compare FIBEREQUIPMENT table to Material Catalog table and determine which objectid's have records that aren't matching
 ipc = {} # 'material_cd' : 'inputportcount'
 ipcOID = {} # 'material_cd' : 'objectid'
 opc = {} # 'material_cd' : 'outputportcount'
 opcOID = {} # 'material_cd' : 'objectid'
 ibc = {} # 'material_cd' : 'inputblockcount'
 ibcOID = {} # 'material_cd' : 'objectid'
 obc = {} # 'material_cd' : 'outputblockcount'
 obcOID = {} # 'material_cd' : 'objectid'

with arcpy.da.SearchCursor(fiberEquipment, fibequip_fields) as cursor:
    for row in cursor:
        ipc[str(row[0])] = row[1]
        ipcOID[str(row[0])] = row[5]
        opc[str(row[0])] = row[2]
        ipcOID[str(row[0])] = row[5]
        ibc[str(row[0])] = row[3]
        ibcOID[str(row[0])] = row[5]
        obc[str(row[0])] = row[4]
        obcOID[str(row[0])] = row[5]

objectID = []

with arcpy.da.SearchCursor(material_catalog, matcd_fields) as cursor:
    for row in cursor:
        if ipc[str(row[1])] == row[1]:
             objectID.append(ipcOID[row[0]])
added 148 characters in body
Source Link
GIS_GOD
  • 399
  • 1
  • 13

I'm trying to check the "fiberEquipment" table against the "material_cd" table and find instances where there are discrepancies. E.G -- Checking that "material_cd" 10785823 in "fiberEquipment" has all the correct values associated with it (inputportcount, outputportcount, inputblockcount, etc.) per the "material_cd" table.

enter image description here

The code I'm using below takes the values from the "fiberEquipment" table, inserts them into a dictionary and than uses a search cursor invoking the dictionary elements to check for discrepancies. The code currently works without any errors, but the logic seems to be flawed, as it's not doing anything when all fields match.

# Fiber Equipment/Material Catalog fields
matcd_fields = ["material_cd"]
fibequip_fields = ["material_cd", "inputportcount", "outputportcount", "inputblockcount", "outputblockcount", "objectid"]
       
# Compare FIBEREQUIPMENT table to Material Catalog table and determine which objectid's have records that aren't matching
ipc = {} # 'material_cd' : 'inputportcount'
opc = {} # 'material_cd' : 'outputportcount'
ibc = {} # 'material_cd' : 'inputblockcount'
obc = {} # 'material_cd' : 'outputblockcount'

with arcpy.da.SearchCursor(fiberEquipment, fibequip_fields) as cursor:
    for row in cursor:
        ipc[str(row[0])] = row[1]
        ipcOID[str(row[0])] = row[5]
        opc[str(row[0])] = row[2]
        ipcOID[str(row[0])] = row[5]
        ibc[str(row[0])] = row[3]
        ibcOID[str(row[0])] = row[5]
        obc[str(row[0])] = row[4]
        obcOID[str(row[0])] = row[5]

objectID = []

with arcpy.da.SearchCursor(material_catalog, matcd_fields) as cursor:
    for row in cursor:
        if row[0] == ipc[str(row[0]row[1])] == row[1]:
             objectID.append(ipc[row[5]]ipcOID[row[0]])

I'm trying to check the "fiberEquipment" table against the "material_cd" table and find instances where there are discrepancies. E.G -- Checking that "material_cd" 10785823 in "fiberEquipment" has all the correct values associated with it (inputportcount, outputportcount, inputblockcount, etc.) per the "material_cd" table.

enter image description here

The code I'm using below takes the values from the "fiberEquipment" table, inserts them into a dictionary and than uses a search cursor invoking the dictionary elements to check for discrepancies. The code currently works without any errors, but the logic seems to be flawed, as it's not doing anything when all fields match.

# Fiber Equipment/Material Catalog fields
matcd_fields = ["material_cd"]
fibequip_fields = ["material_cd", "inputportcount", "outputportcount", "inputblockcount", "outputblockcount", "objectid"]
       
# Compare FIBEREQUIPMENT table to Material Catalog table and determine which objectid's have records that aren't matching
ipc = {} # 'material_cd' : 'inputportcount'
opc = {} # 'material_cd' : 'outputportcount'
ibc = {} # 'material_cd' : 'inputblockcount'
obc = {} # 'material_cd' : 'outputblockcount'

with arcpy.da.SearchCursor(fiberEquipment, fibequip_fields) as cursor:
    for row in cursor:
        ipc[str(row[0])] = row[1]
        opc[str(row[0])] = row[2]
        ibc[str(row[0])] = row[3]
        obc[str(row[0])] = row[4]

objectID = []

with arcpy.da.SearchCursor(material_catalog, matcd_fields) as cursor:
    for row in cursor:
        if row[0] == ipc[str(row[0])]:
            objectID.append(ipc[row[5]])

I'm trying to check the "fiberEquipment" table against the "material_cd" table and find instances where there are discrepancies. E.G -- Checking that "material_cd" 10785823 in "fiberEquipment" has all the correct values associated with it (inputportcount, outputportcount, inputblockcount, etc.) per the "material_cd" table.

enter image description here

The code I'm using below takes the values from the "fiberEquipment" table, inserts them into a dictionary and than uses a search cursor invoking the dictionary elements to check for discrepancies. The code currently works without any errors, but the logic seems to be flawed, as it's not doing anything when all fields match.

# Fiber Equipment/Material Catalog fields
matcd_fields = ["material_cd"]
fibequip_fields = ["material_cd", "inputportcount", "outputportcount", "inputblockcount", "outputblockcount", "objectid"]
       
# Compare FIBEREQUIPMENT table to Material Catalog table and determine which objectid's have records that aren't matching
ipc = {} # 'material_cd' : 'inputportcount'
opc = {} # 'material_cd' : 'outputportcount'
ibc = {} # 'material_cd' : 'inputblockcount'
obc = {} # 'material_cd' : 'outputblockcount'

with arcpy.da.SearchCursor(fiberEquipment, fibequip_fields) as cursor:
    for row in cursor:
        ipc[str(row[0])] = row[1]
        ipcOID[str(row[0])] = row[5]
        opc[str(row[0])] = row[2]
        ipcOID[str(row[0])] = row[5]
        ibc[str(row[0])] = row[3]
        ibcOID[str(row[0])] = row[5]
        obc[str(row[0])] = row[4]
        obcOID[str(row[0])] = row[5]

objectID = []

with arcpy.da.SearchCursor(material_catalog, matcd_fields) as cursor:
    for row in cursor:
        if ipc[str(row[1])] == row[1]:
             objectID.append(ipcOID[row[0]])
Added language tag
Source Link
Hornbydd
  • 44.6k
  • 5
  • 42
  • 84
Loading
Source Link
GIS_GOD
  • 399
  • 1
  • 13
Loading