Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python contains multiple strings pandas

string_list = pd.Series(['dog', 'doggy', 'doggo', 'canine', 'kitten', 'cat', 'kitty', 'feline' ])
matches = 'dog|kit' # you can have multiple validations in one string with the | operator
print(string_list[ string_list.str.contains(matches)])
#0       dog
#1     doggy
#2     doggo
#4    kitten
#6     kitty
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #multiple #strings #pandas
ADD COMMENT
Topic
Name
6+6 =