JuliaData / DataAPI.jl

A data-focused namespace for packages to share functions
Other
33 stars 13 forks source link

ellipsis notation for Beetwen #30

Open CarloLucibello opened 3 years ago

CarloLucibello commented 3 years ago

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

bkamins commented 3 years ago

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

CarloLucibello commented 3 years ago

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

bkamins commented 3 years ago

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

nalimilan commented 3 years ago

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.