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

simple groupby example fails

Open jwright11 opened this issue 4 years ago • 1 comments

Hi All,

I'm new to JuliaDB and just trying to go through the examples to get familiar with the package. I'm getting an error on a simple groupby example. I'm on Julia 1.5.3 on Windows 10. Any ideas on what's going on?

julia> using Statistics

julia> t=table([1,1,1,2,2,2], [1,1,2,2,1,1], [1,2,3,4,5,6], names=[:x,:y,:z])
Table with 6 rows, 3 columns:
x  y  z
───────
1  1  1
1  1  2
1  2  3
2  2  4
2  1  5
2  1  6

julia> groupby(mean, t, :x, select=:z)
ERROR: UndefVarError: _default_type not defined
Stacktrace:
 [1] _promote_op(::Function, ::Type{Array{Int64,1}}) at C:\Users\wrighjo\.julia\packages\IndexedTables\Jw0SP\src\utils.jl:247
 [2] reduced_type at C:\Users\wrighjo\.julia\packages\IndexedTables\Jw0SP\src\columns.jl:1213 [inlined]
 [3] reduced_type at C:\Users\wrighjo\.julia\packages\IndexedTables\Jw0SP\src\columns.jl:1210 [inlined]
 [4] init_inputs at C:\Users\wrighjo\.julia\packages\IndexedTables\Jw0SP\src\columns.jl:1221 [inlined]
 [5] groupby(::Function, ::NextTable{Columns{NamedTuple{(:x, :y, :z),Tuple{Int64,Int64,Int64}},NamedTuple{(:x, :y, :z),Tuple{Array{Int64,1},Array{Int64,1},Array{Int64,1}}}}}, ::Symbol; select::Symbol, flatten::Bool, usekey::Bool) at C:\Users\wrighjo\.julia\packages\IndexedTables\Jw0SP\src\reduce.jl:415
 [6] top-level scope at REPL[18]:1

jwright11 avatar Jan 17 '21 16:01 jwright11

I got this error when I installed JuliaDB in an environment with other packages. Try creating a new environment with just:

] add JuliaDB Tables

See if you get the same error. I think this package needs to update a lot of its dependencies. There are several pull requests from a CompatHelper bot to bump the dependencies version that needs attention.

Also try this:

groupby(mean, t, (:x => string), select=:z)

storopoli avatar Mar 07 '21 18:03 storopoli