I have some values in the risk
column that are neither, Small
, Medium
or High
. I want to delete the rows with the value not being Small
, Medium
and High
. I tried the following:
df = df[(df.risk == "Small") | (df.risk == "Medium") | (df.risk == "High")]
But this returns an empty DataFrame. How can I filter them correctly?