Row Selection with filter
verb
We can select rows by using the filter
verb. In the filter
verb we pass the condition we are using to select the rows.
Tidyverse
%>% filter(value_weight > 3) df
color | size | value_weight | value_height |
---|---|---|---|
red | large | 8 | 45 |
green | large | 9 | 42 |
Polars
filter(pl.col("value_weight") > 3) df.
shape: (2, 4)
color | size | value_weight | value_height |
---|---|---|---|
str | str | i64 | i64 |
"red" | "large" | 8 | 45 |
"green" | "large" | 9 | 42 |