JuliaData / TypedTables.jl

Simple, fast, column-based storage for data analysis in Julia
Other
145 stars 25 forks source link

`size()` doesn't report correct ncols #85

Closed Moelf closed 2 years ago

Moelf commented 2 years ago

IMO the current definition would only make sense if TypedTables is stored by rows https://github.com/JuliaData/TypedTables.jl/blob/1c0ef0255cd6d61216c57d568c2d66e120cb46ff/src/Table.jl#L109

julia> size(UnROOT.innertable(tf))
(61540413,)

julia> typeof(UnROOT.innertable(tf))
TypedTables.Table{NamedTuple{(:Muon_phi

we should probably go over some interfaces to make sure the table looks like a table (i.e. ndims == 2, size has two elements)

Moelf commented 2 years ago

I think I get it now, the issue is we don't want broadcast to treat the table as a matrix, we want to be treated as a vector of namedtuple (for the speed)

andyferris commented 2 years ago

(for the speed)

It's more for the semantics. We map rows and filter rows and reduce over rows, and we can define innerjoin over things that iterate rather than just tables in particular. It is intentially a nested container.