You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/man/filter.md
+9-27Lines changed: 9 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,12 @@ be set as `all` or `any`, and supply the conditions by using the `by` keyword op
13
13
14
14
The main feature of `byrow(ds, fun, cols, by = ...)` when `fun` is `all/any` is that the `by` keyword argument can be a vector of functions. Thus, when a multiple columns are supplied as `cols` each column can have its own `by`.
15
15
16
+
### `filter` and `filter!`
17
+
18
+
The `filter` and `filter!` functions are two shortcuts for doing the `byrow` and `getindex` operations at the same call.
19
+
20
+
`filter(ds, cols; [type = all, by = isequal(true),...])` is the shortcut for `ds[byrow(ds, type, cols; by = by,...), :]`, and `filter!(ds, cols; [type = all, by = isequal(true),...])` is the shortcut for `deleteat![ds, byrow(ds, type, cols; by = by,...))`.
21
+
16
22
### Examples
17
23
18
24
The first expression creates a data set, and in the second one we use `byrow` to filter `all` rows which the values of all columns are equal to 1.
@@ -53,20 +59,8 @@ Note that only the first row is meeting the condition. As another example, let's
53
59
filter all rows which the numbers in all columns are odd.
0 commit comments