def preprocess_data(p_x, p_stats):
    """
    Make data standard/normal.
    More info: https://dataakkadian.medium.com/standardization-vs-normalization-da7a3a308c64
    https://www.kdnuggets.com/2020/04/data-transformation-standardization-normalization.html
    :param p_x: input data
    :param p_stats: input data statistics
    :return: standardized and normalized data
    """
    p_standardized = (p_x - p_stats["mean"]) / p_stats["std"]  # mean = 0, std = 1
    p_normalized = (p_x - p_stats["min"]) / (p_stats["max"] - p_stats["min"])  # range 0-1
    return p_standardized, p_normalized