def get_stats(self, array, name):
    stats = [np.mean, np.max, np.min, np.sum, np.var]
    result = {}
    if len(array):
        for stat in stats:
            result[((name + '_') + stat.__name__)] = stat(array)
    else:
        for stat in stats:
            result[((name + '_') + stat.__name__)] = 0
    return result
def get_stats(self, array, name):
    stats = [np.mean, np.max, np.min, np.sum, np.var]
    result = {}
    if len(array):
        for stat in stats:
            result[((name + '_') + stat.__name__)] = stat(array)
    else:
        for stat in stats:
            result[((name + '_') + stat.__name__)] = 0
    return result