def arecode (a,listmap,col='all'):
        ashape = a.shape
        if col == 'all':
            work = a.ravel()
        else:
            work = acolex(a,col)
            work = work.ravel()
        for pair in listmap:
            if type(pair[1]) == StringType or work.dtype.char=='O' or a.dtype.char=='O':
                work = N.array(work,dtype='O')
                a = N.array(a,dtype='O')
                for i in range(len(work)):
                    if work[i]==pair[0]:
                        work[i] = pair[1]
                if col == 'all':
                    return N.reshape(work,ashape)
                else:
                    return N.concatenate([a[:,0:col],work[:,N.newaxis],a[:,col+1:]],1)
            else:   # must be a non-Object type array and replacement
                work = N.where(work==pair[0],pair[1],work)
                return N.concatenate([a[:,0:col],work[:,N.newaxis],a[:,col+1:]],1)
Return the mean of all pixel values of this band.
dataset/ETHPy150Open sunlightlabs/clearspending/completeness/statlib/pstat.py/arecode--crossover with--dataset/ETHPy150Open django/django/django/contrib/gis/gdal/raster/band.py/GDALBand.mean