I was wondering if anyone knows if it is possible to calculate a field based on the most frequently occurring value in other fields.
What I have is 5 fields with crop information over 5 consecutive years. What I want is to create a new field with the most frequently occurring crop over that 5 year period.
So for example if there were fields for Crop 2008, Crop 2009, Crop 2010, Crop 2011 and Crop 2012 with respective crop types for the first polygon as Winter Wheat, Spring Barley, Winter Barley, Winter Wheat and Grass the function would return Winter Wheat because it appears twice.
I am aware there is a function called Counter in the Collections package that can do this for a list but I'm unsure how this would work within the arcpy field calculation tool?
Likewise there also needs to be a consideration for values that tie i.e. appear the same amount of times across the 5 fields.
I can't seem to find anything else from my searching about.
I'm using ArcGIS 10 and hoping to calculate fields in the python window.
Apologies for not providing any attempts at coding this so far, I really am stumped on this one!