diff --git a/src/subset.jl b/src/subset.jl index 6335582..fdce095 100644 --- a/src/subset.jl +++ b/src/subset.jl @@ -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