def lookup_counts(
    row,
    lookup_table,
    index="step",
    columns="participant",
    default=False
):
    """
    Function to apply to a DataFrame to cross-reference
    counts in a lookup_table.

    Parameters
    ----------
    row: Series
        row of a DataFrame

    lookup_table: DataFrame
        DataFrame to cross-reference

    index: string or numeric, opitional
        name of column in row that contains an index value
        for lookup_table, default = "step"

    columns: string or numeric, opitional
        name of column in row that contains a column name
        for lookup_table, default = "participant"

    default: boolean or other, optional
        value to return if lookup not in lookup table
        default = False

    Returns
    -------
    value: boolean or other
        the value at index, columns; otherwise default
    """
    try:
        return(
            lookup_table.loc[
                row[index],
                row[columns]
            ].all()
        )
    except:
        return(default)