Hi All,
I have created a script that does some data checks and I am down to my last check. Where I am stuck at is comparing time Values between rows in a Search Cursor.
for example I will have several tables that have 2-10 values in them.
My code looks something like this:
table = 'b3514str133'
field = "INP_DATE"
tempList = []
with arcpy.da.SearchCursor(table, field) as cursor:
for row in cursor:
tempList.append(row)
# My Templist now looks like this : [(datetime.datetime(2015, 4, 1, 14, 22, 4),),
(datetime.datetime(2015, 4, 1, 14, 22, 10),),
(datetime.datetime(2015, 4, 1, 14, 22, 15),),
(datetime.datetime(2015, 4, 1, 14, 22, 20),),
(datetime.datetime(2015, 4, 1, 14, 22, 37),)]
for item in tempList:
if any of the items are within 1 hour of each other:
print row
My first question is: Is this the easiest way to do this?
My Second question is: Should I be using a list to do this or can i compare each row by all the other rows?
My third question is: What if statement could i used to compare each row within 1 hour of each other?
My checks go through about 5 different levels of verification so my mind is currently blown!!!!
Any help would be great thanks!
-Matt