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: src/dataset/other.jl
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1038,7 +1038,7 @@ julia> filter(ds, 2:3, type = isless, with = :x)
1038
1038
3 │ 5 2.0 true
1039
1039
```
1040
1040
"""
1041
-
function Base.filter(ds::AbstractDataset, cols::Union{Vector{T}, ColumnIndex, MultiColumnIndex}; view =false, type= all, kwargs...) where T <:Union{<:Integer, Symbol, AbstractString}
1041
+
function Base.filter(ds::AbstractDataset, cols::Union{NTuple{N, ColumnIndex}, Vector{T}, ColumnIndex, MultiColumnIndex}; view =false, type= all, kwargs...)where Nwhere T <:Union{<:Integer, Symbol, AbstractString}
@@ -1058,9 +1058,11 @@ Refer to [`filter`](@ref) for exmaples.
1058
1058
1059
1059
See [`byrow`](@ref), [`filter`](@ref), [`delete!`](@ref), [`delete`](@ref)
1060
1060
"""
1061
-
_filter!(ds::Dataset, cols::Union{AbstractVector{T}, ColumnIndex, MultiColumnIndex}; type = all, kwargs...) where T <:Union{<:Integer, Symbol, AbstractString}=deleteat!(ds, .!byrow(ds, type, cols; kwargs...))
1061
+
_filter!(ds::Dataset, cols::Union{NTuple{N, ColumnIndex}, AbstractVector{T}, ColumnIndex, MultiColumnIndex}; type = all, kwargs...)where Nwhere T <:Union{<:Integer, Symbol, AbstractString}=deleteat!(ds, .!byrow(ds, type, cols; kwargs...))
1062
1062
Base.filter!(ds::Dataset, cols::AbstractVector; type = all, kwargs...) =_filter!(ds, cols; type = type, kwargs...)
1063
1063
Base.filter!(ds::Dataset, cols::Union{ColumnIndex, MultiColumnIndex}; type = all, kwargs...) =_filter!(ds, cols; type = type, kwargs...)
1064
+
Base.filter!(ds::Dataset, cols::NTuple{N, ColumnIndex}; kwargs...) where N =_filter!(ds, cols; kwargs...)
1065
+
1064
1066
1065
1067
# filter out `true`s
1066
1068
"""
@@ -1139,7 +1141,7 @@ julia> delete(ds, 2:3, type = isless, with = :x)
1139
1141
2 │ 2 2.3 false
1140
1142
```
1141
1143
"""
1142
-
functiondelete(ds::AbstractDataset, cols::Union{ColumnIndex, MultiColumnIndex}; view =false, type= all, kwargs...)
1144
+
functiondelete(ds::AbstractDataset, cols::Union{NTuple{N, ColumnIndex}, ColumnIndex, MultiColumnIndex}; view =false, type= all, kwargs...)where N
0 commit comments