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

Support subdataframes

Open piever opened this issue 8 years ago • 1 comments

Currently SubDataFrames are not iterable tables, which is unfortunate as it's actually surprisingly clumsy to convert them to DataFrames. The current method to iterate on DataFrames could probably have a weaker signature and maybe that'd be enough to have it work on any AbstractDataFrame. The main application would be to be able to use it in a by call, see this discourse post

julia> using IterableTables

julia> df = DataFrame(x = rand(10));

julia> by(TableTraits.isiterabletable, df, :x)
10×2 DataFrames.DataFrame
│ Row │ x        │ x1    │
├─────┼──────────┼───────┤
│ 1   │ 0.67292  │ false │
│ 2   │ 0.921996 │ false │
│ 3   │ 0.517816 │ false │
│ 4   │ 0.822496 │ false │
│ 5   │ 0.120007 │ false │
│ 6   │ 0.289319 │ false │
│ 7   │ 0.113851 │ false │
│ 8   │ 0.826421 │ false │
│ 9   │ 0.881944 │ false │
│ 10  │ 0.279972 │ false │

piever avatar Apr 20 '18 13:04 piever

This might already work with the new code in DataFrames.jl, and if it doesn't, it would have to be supported there.

davidanthoff avatar Oct 30 '18 20:10 davidanthoff