def mean_center_utilmat(U, axis=1, fillna=True, fill_val=None):
    """Gets the mean-centered utility matrix

    Parameters:
        U (DataFrame) : utilily matrix (rows are users, columns are items) 
        axis (int) : The axis along mean is evaluated, 
            {0/'index', 1/'columns'}, default 1
        fillna (bool) : Indicates whether missing/null values are to be filled
        fill_val (None/float) : Value to be used to fill null values when 
            fillna==True, default None

    Returns:
        U (DataFrame): mean-centered utility matrix
    """
    mean_centered = U.sub(U.mean(axis=axis), axis=1-axis)
    if fillna:
        if fill_val is not None:
            return mean_centered.fillna(fill_val)
        else:
            return mean_centered.fillna(0)
    else:
        return mean_centered