# if there are null values (e.g. NaN) values in the column, then the following
# error will show:
# "Cannot mask with non-boolean array containing NA / NaN values"
# setting na=False for the contains() method solves the problem
df['column_name'].str.contains(string_to_be_matched_with, na=False)