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
In the first case, `[:A]` is a vector, indicating that the resulting object should be a `DataFrame`. On the other hand, `:A` is a single symbol, indicating that a single column vector should be extracted. Note that in the first case a vector is required to be passed (not just any iterable), so e.g. `df[:, (:x1, :x2)]` is not allowed, but `df[:, [:x1, :x2]]` is valid.
459
+
In the first case, `[:A]` is a vector, indicating that the resulting object
460
+
should be a `DataFrame`. On the other hand, `:A` is a single symbol, indicating
461
+
that a single column vector should be extracted. Note that in the first case a
462
+
vector is required to be passed (not just any iterable), so e.g. `df[:, (:x1,
463
+
:x2)]` is not allowed, but `df[:, [:x1, :x2]]` is valid.
460
464
461
465
It is also possible to use a regular expression as a selector of columns matching it:
462
466
```jldoctest dataframe
@@ -475,7 +479,9 @@ julia> df[!, r"x"]
475
479
│ 1 │ 1 │ 2 │
476
480
```
477
481
478
-
A `Not` selector (from the [InvertedIndices](https://github.com/mbauman/InvertedIndices.jl) package) can be used to select all columns excluding a specific subset:
482
+
A `Not` selector (from the
483
+
[InvertedIndices](https://github.com/mbauman/InvertedIndices.jl) package) can be
484
+
used to select all columns excluding a specific subset:
479
485
480
486
```jldoctest dataframe
481
487
julia> df[!, Not(:x1)]
@@ -486,8 +492,13 @@ julia> df[!, Not(:x1)]
486
492
│ 1 │ 2 │ 3 │
487
493
```
488
494
489
-
Finally, you can use `Not`, `Between`, and `All` selectors in more complex column selection scenarios.
490
-
The following examples move all columns whose names match `r"x"` regular expression respectively to the front and to the end of a data frame:
495
+
Finally, you can use `Not`, `Between`, `Cols` and `All` selectors in more
496
+
complex column selection scenarios (note that `Cols()` selects no columns while
497
+
`All()` selects all columns therefore `Cols` is a preferred selector if you
498
+
write generic code). The following examples move all columns whose names match
499
+
`r"x"` regular expression respectively to the front and to the end of a data
0 commit comments