Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas str is in list

mylist = ['dog', 'cat', 'fish']
pattern = '|'.join(mylist)

pattern
'dog|cat|fish'

frame.a.str.contains(pattern)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #str #list
ADD COMMENT
Topic
Name
9+2 =