def majority(self, var1):
        vunique = numpy.ma.compressed(numpy.unique(var1))
        vcounts = numpy.zeros_like(vunique)
        for vindex in range(0, vunique.size):
            vcounts[vindex] = numpy.ma.sum(var1 == vunique[vindex])
        return vunique[numpy.argmax(vcounts)]
Calculates majority for given NumPy array.  The lowest value
dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/suitability/toolboxes/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/tools/multidimensional_zonal_statistics.py/MultidimensionalZonalStatistics.majority