0

In a pandas dataframe, I need to create a filter on a column (containing string) depending on the value.

By example in the column we can have : Iris-setosa Iris-versicolor Iris-virginica

if the user enter "setosa", I want only the lines with the value "Iris-setosa". How is it possible to do that ?

I try : mask = "setosa" in dataframe[columnName]

but it didn't work ...

mask = dataframe[columnName] == filterValue works fine but it's not the objective ...

0 Answers0