0

I want to get all rows which DO NOT have a value of the "previous_page_path" column in the set ("forbidden_val_1", "forbidden_val_2"). I've tried this:

dfRefUrl.filter(dfRefUrl["previous_page_path"] in ("forbidden_val_1", "forbidden_val_2"))

but it crashes my program. Is there any way to do this kind of filtering?

Sahand
  • 7,980
  • 23
  • 69
  • 137
  • use `dfRefUrl["previous_page_path"].isin(("forbidden_val_1", "forbidden_val_2"))` .. looking for the right dupe – pault Mar 27 '19 at 17:27
  • 1
    Possible duplicate of [Filtering a Pyspark DataFrame with SQL-like IN clause](https://stackoverflow.com/questions/35870760/filtering-a-pyspark-dataframe-with-sql-like-in-clause) and [pyspark dataframe filter or include based on list](https://stackoverflow.com/questions/40421845/pyspark-dataframe-filter-or-include-based-on-list) and [How to filter column on values in list in pyspark?](https://stackoverflow.com/questions/46707339/how-to-filter-column-on-values-in-list-in-pyspark?rq=1) – pault Mar 27 '19 at 17:28

0 Answers0