I have a geodatabase table with the following fields: County_Name, State_Name, Date_Time, Customers
Example
Alameda, CA, 8/1/2014 12AM, 6
Alameda, CA, 8/1/2014 1AM, 1
Alameda, CA, 8/1/2014 2AM, 3
....
Data for all US counties is in the table. I just want to create a new table that contains the
- county, state, max customers for the day (24 hour period), time of the max customers
- county, state, min customers for the day (24 hour period), time of the min customers
Many states have the same county names as other states.
Do I need to create a cursor to obtain a list of the unique county and state names first?
This will give me a list of the county names but I also need the state names.
with arcpy.da.SearchCursor(tablesMerged, ["county_nam"]) as cursor:
print sorted({row[0] for rows in cursor})
Best Answer
Since you said you just need a hint with python I came up with this:
My test table:
Thats the Output generated:
Then you only need an UpdateCursor and the formatting for the time. Information regarding this you will find here: http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000014000000 and http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000046000000