hammacktony
1/15/2020 - 11:30 PM

Numpy Data Inspection helpers

Numpy Data Inspection helpers

import numpy as np

from typing import Dict


def stats(data: np.ndarray) -> Dict[str, float]:
    """ Return basic stats about array """
    return {
        "min": data.min(),
        "max": data.max(),
        "mean": data.mean(),
        "median": np.median(data),
        "std": data.std()
    }