Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #Comparison
  2. a = pd.Series(['1','2','3'])
  3. b = pd.Series([['1','a','b'],['we','po'],['qwe','3']])
  4.  
  5. # map(function, iterable, ...) - function is applied over each element in iterable
  6. # lambda arguments : expression - expression is executed over arguments and returned. ANONYMOUS FUNCTION
  7.  
  8. #
  9. list(map(lambda x : x[0] in x[1] # The lambda fucuntion takes in the tuple in this case and perform the function in the
  10. ,zip(a,b))) # Here we zip the series a and b creating a list of tuples.
  11. # Each of these tuples is passed to the lambda function which applies its expression onthe args.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement