I need to search and drop rows that has a complete sentence contains in in the cell.
I tried with df = df[~df.datacell.str.contains("find my string in this column")]
But seems like it drops all the rows that has any one or more words in the sentence.
Asked
Active
Viewed 18 times
0

Vijesh Kk
- 141
- 2
- 11
-
1Use `df[~df.datacell.eq("find my string in this column")]` or `df[~(df.datacell == "find my string in this column")]` – jezrael Dec 30 '19 at 05:27
-
@jezrael will it drop only if its a complete match? my cell may contain additional words before and after of this sentence: `you need to find my string in the column` – Vijesh Kk Dec 30 '19 at 05:41
-
Can you add some sample to question with expected output? – jezrael Dec 30 '19 at 05:48