Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas string does not contain

# simply use the invert operator '~' with 'str.contains'
new_df = df[~df["col"].str.contains(word)]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #string
ADD COMMENT
Topic
Name
2+3 =