I am attempting to get a list of row numbers for any rows including either of two values (-1.797693e+308 and -2147483648) in a list of columns.
I am using an Arcpy search cursor to loop through columns based on a list of headings.
Within each loop I am looking at two columns - the Index column and the column potentially containing either of the two numbers (a) - I then want the Index Column value to be returned.
At the moment the process is successful with uncomplicated numbers (ie 1 or 2) but seems to be struggling with the two numbers I am looking for - potentially as one is actually a string and the other is a minus number.
How could I adjust this so that the loop is able to pick up these numbers / strings?
Field_List = getFieldNames(Shapefile) Field_Matchers = ['CON',"CAT"] Search_Fields = [s for s in Field_List if any(xs in s for xs in Field_Matchers)] for t in Search_Fields: FILE = Shapefile fields = ["INDEX_COL"] fields.append(t) cursor = arcpy.SearchCursor(FILE) for row in cursor: a = ["-1.797693e+308", "-2147483648"] #print row.getValue(fields) if str(row.getValue(fields)) in a : print (row.getValue(fields)) fields =["INDEX_COL"]