def constant_col_finder(x, exclude_cols=None):
    """Finds constant columns in x.

    A column is considered as a constant column if all rows have the same value
    and the value is not zero.

    Parameters
    ----------
    x : `numpy.array`
        The design matrix.
    exclude_cols : `list`[`int`], default None
        Columns in ``exlucde_cols`` are not considered as constant columns.

    Returns
    -------
    constant_cols : `list`[`int`]
        A list of indices that satisfy the constant column conditions.
    """
    if exclude_cols is None:
        exclude_cols = []
    var = x.var(axis=0)
    constant_cols = [i for i in range(len(var)) if var[i] == 0 and x[0, i] != 0 and i not in exclude_cols]
    return constant_cols