R has a match() function, for example:
a=c(1,2,3,4,5)
b=c(1,2,6)
match(b,a,nomatch=-1) #find index of b values in a
Index values in R are 1-based, so the match() call above will output:
1 2 -1
What's the equivalent function or the best way to implement it in Python ? Thanks in advance.