DataAPI.jl icon indicating copy to clipboard operation
DataAPI.jl copied to clipboard

ellipsis notation for Beetwen

Open CarloLucibello opened this issue 4 years ago • 4 comments

I was thinking that it may be convenient and intuitive to use IntervalSets.jl's ellipsis notation as an alternative to Between(:a, :b):

df[:, :a..:b]
df[:, :a..end]

Sorry if this has already been discussed before.

Best, Carlo

CarloLucibello avatar Nov 10 '20 07:11 CarloLucibello

I am transferring this discussion to DataAPI.jl as Between is defined there.

bkamins avatar Nov 10 '20 07:11 bkamins

Thanks. As an additional comment, IntervalSets already support intervals with symbols

julia> using IntervalSets

julia> :a..:b
a..b

julia> (:a..:b).left
:a

and we also have the equivalent of the empty arguments Between():

julia> ..
EllipsisNotation.Ellipsis()

therefore it is just a matter of implementing support in the data ecosystem

CarloLucibello avatar Nov 10 '20 08:11 CarloLucibello

The thing that should be checked is how heavy this dependency is.

bkamins avatar Nov 10 '20 08:11 bkamins

Interesting. At any rate I don't think DataAPI would depend on IntervalSets: packages like DataFrames could reexport the .. notation from IntervalSets and accept it as an alternative to Between. But as @bkamins said that would add another dependency so we should check how costly it is in terms of load times and latency.

nalimilan avatar Nov 15 '20 14:11 nalimilan