def match(v1, v2, nomatch=-<NUM_LIT:1>, incomparables=None, start=<NUM_LIT:0>):
v2_indices = {}<EOL>for i, x in enumerate(v2):<EOL><INDENT>if x not in v2_indices:<EOL><INDENT>v2_indices[x] = i<EOL><DEDENT><DEDENT>v1_to_v2_map = [nomatch] * len(v1)<EOL>skip = set(incomparables) if incomparables else set()<EOL>for i, x in enumerate(v1):<EOL><INDENT>if x in skip:<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>v1_to_v2_map[i] = v2_indices[x] + start<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return v1_to_v2_map<EOL>
Return a vector of the positions of (first)
matches of its first argument in its second.

Parameters
----------
v1: array_like
    Values to be matched

v2: array_like
    Values to be matched against

nomatch: int
    Value to be returned in the case when
    no match is found.

incomparables: array_like
    Values that cannot be matched. Any value in ``v1``
    matching a value in this list is assigned the nomatch
    value.
start: int
    Type of indexing to use. Most likely 0 or 1