Good Afternoon ArcPy Wizards!
I would love some input on my code.
I am trying to capture the earliest positive in a grid and then count the negative sample that were required before the positive.
The Code:
I get a syntax error at
Ive tried adding the keyword date before "SAMPLE_DATE" and many other ways.
Thanks!
Alicia
I would love some input on my code.
I am trying to capture the earliest positive in a grid and then count the negative sample that were required before the positive.
The Code:
Code:
for grid in grids:
dates = []
arcpy.SelectLayerByLocation_management("cwdpts4Anlys", "WITHIN", grid.shape, "NEW_SELECTION")
positives = arcpy.SearchCursor("cwdpts4Anlys",' "ELISALYMPHNODE" = \'Positive\' ' , "", "SAMPLE_ DATE" ')
for positive in positives:
dates.append(row[0])
earliest = min(dates)
arcpy.SelectLayerByLocation_management("cwdpts4Anlys", "WITHIN", grid.shape, "NEW_SELECTION")
arcpy.SelectLayerByAttribute_management("cwdpts4Anlys", "SUBSET_SELECTION", ' "ELISALYMPHNODE" = \'Negative\' ')
arcpy.SelectLayerByAttribute_management("cwdpts4Anlys","SUBSET_SELECTION",'"SAMPLE_DATE" <= date earliest ' )
negatives = int(arcpy.GetCount_management("cwdpts4Anlys").getOutput(0))
grid.setValue('NegPrior2Pos', negatives)
grids.updateRow(grid)Code:
positives = arcpy.SearchCursor("cwdpts4Anlys",' "ELISALYMPHNODE" = \'Positive\' ' , "", "SAMPLE_ DATE" ')Thanks!
Alicia