Skip to content

Commit

Permalink
Updating subset.jl to make it compatible with the Julia version 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
siddjain444 committed Mar 20, 2024
1 parent 4f45889 commit ce4d3d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/subset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ julia> subset(ts,Date("2022-9-27"),:)
"""
function subset(ts::TSFrame, from::T, to::T) where {T<:Union{Int, TimeType}}
TSFrame(DataFrames.subset(ts.coredata, :Index => x -> x .>= from .&& x .<= to))
TSFrame(DataFrames.subset(ts.coredata, :Index => x -> from .<= x .<= to))
end


function subset(ts::TSFrame, ::Colon, to::T) where {T<:Union{Int, TimeType}}
TSFrame(DataFrames.subset(ts.coredata, :Index => x -> x .<= to))
end
Expand Down

0 comments on commit ce4d3d6

Please sign in to comment.