def get_pair_equality(row, column_1, column_2):
    """
    Helper function used by pair_equality, to test values of two columns for
    equality in a single row.

    :param row:
        Row from dataframe
    :param column_1:
        Name of first column
    :param column_2:
        Name of second column
    :return:
        1 if and only if the row has the same value in two given columns
    """
    if row[column_1] == row[column_2]:
        return 1
    else:
        return 0