Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple groupby example fails #375

Open
jwright11 opened this issue Jan 17, 2021 · 1 comment
Open

simple groupby example fails #375

jwright11 opened this issue Jan 17, 2021 · 1 comment

Comments

@jwright11
Copy link

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
@storopoli
Copy link

storopoli commented Mar 7, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants