Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

queue.empty error when using search cursor

$
0
0

I’m having trouble with an error message and can’t seem to figure out the reason which, I’m sure is something simple. I have a bit of code listed below:

insertPts = arcpy.da.InsertCursor(newFC, ( "FieldA", "FieldB"))

with arcpy.da.SearchCursor(FC, ("FieldA", "FieldB"),""" "FieldA" IS NOT NULL """) as search:
    for row in search:
        num = row[0]
        rPtsNumber = randint(1, row[0])
        row[0] = rPtsNumber
        PTSid = int(row[1])
        for x in xrange (num):
            insertPts.insertRow((rPtsNumber, PTSid))

the error occurs in the line ‘for row in search:’. I though it may be an issue with the where clause however, I tried creating a new feature class based on the where clause criteria and continue to get the error. Thanks for any help you can provide.


Viewing all articles
Browse latest Browse all 767

Trending Articles