def _normalize_vals(x: list[int] | list[float] | list[int | float]) -> list[int | float]:
    """
    Normalize a list of numeric values to be between 0 and 1. Account for missing values.
    """

    x_missing = [i for i, val in enumerate(x) if _is_na(val)]
    mean_x = np.mean([val for val in x if not _is_na(val)])
    x = [mean_x if _is_na(val) else val for val in x]
    x = np.array(x)
    min_attr = np.min(x, axis=0)
    max_attr = np.max(x, axis=0)
    x = x - min_attr
    x = x / (max_attr - min_attr)
    x = x.tolist()
    x = [np.nan if i in x_missing else val for i, val in enumerate(x)]
    return x

    Normalize a list of numeric values to be between 0 and 1. Account for missing values.
    
great_tables/_utils_nanoplots.py