Polars has a special data type that allows you to filter text values based on hierarchy. Let’s create a dataframe where the Degree column is of the data type Enum.
Because the Degree column is of type Enum, you can use inequality symbols to filter text values as if they were numbers. For example, you can filter for students who have a master’s degree (MSc) or higher like this: