def left_outer_join(left_rows, left_column_id, right_rows, right_column_id, header=True):
    len_left_headers = len(left_rows[0])
    len_right_headers = len(right_rows[0])

    if header:
        output = [left_rows[0] + right_rows[0]]
        left_rows = left_rows[1:]
        right_rows = right_rows[1:]
    else:
        output = []

    # Get mapped keys
    right_mapped_keys = _get_mapped_keys(right_rows, right_column_id)

    for left_row in left_rows:
        len_left_row = len(left_row)
        left_key = left_row[left_column_id]

        if len_left_row < len_left_headers:
            left_row.extend([None] * (len_left_headers - len_left_row))

        if left_key in right_mapped_keys:
            for right_row in right_mapped_keys[left_key]:
                output.append(left_row + right_row)
        else:
            output.append(left_row + ([u''] * len_right_headers))

    return output
Execute left outer join on two tables and return the combined table.
dataset/ETHPy150Open wireservice/csvkit/csvkit/join.py/left_outer_join