JuliaData / IndexedTables.jl

Flexible tables with ordered indices
https://juliadb.org
MIT License
121 stars 37 forks source link

Select which::any #266

Open dfujim opened 4 years ago

dfujim commented 4 years ago

Hi, I often want to read data from a CSV where my columns denote some floating point number. For example, I measure a set of time series', each corresponding to a different numerical setting. My CSV looks similar to:

t,1.2,1.3
1,2,3
4,5,6

When I load this with JuliaDB, for example, I need to select the columns as symbols, such as in the following example

using JuliaDB
db = loadtable("demo.csv");
select(db,Symbol(1.2))

I can, however, extend the definition in the following way which makes my life easier:

import IndexedTables.select
select(t::IndexedTable,which::Any) = select(t,Symbol(which))

Is there a good reason not to do this? If not, can this definition be added? Thanks!