def stats(source):
    if isinstance(source, tuple):
        arr = source[0].read(source[1])
    else:
        arr = source
    return Stats(numpy.min(arr), numpy.max(arr), numpy.mean(arr))
Return a tuple with raster min, max, and mean.
dataset/ETHPy150Open mapbox/rasterio/rasterio/rio/insp.py/stats