You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no elegant solution at this point, but I hope to add something like @summarize down the road (#84).
For now, here is what you can do. If you want to summarize the whole query, i.e. not based on some grouping, then you can just do this by hand after the query has run:
df =DataFrame(a=[1,2,3], b=[4,5,6])
x =@from i in df begin@select i
end
x2 =mean(collect(@select(x,i->i.a)))
This query is slightly more involved than yours because it uses columns, if your query just returned a list of Ints, then you could obviously skip the whole @select statement in the last line. The collect in the last line is annoying, but right now required (#85).
df =DataFrame(name=repeat(["John", "Sally", "Kirk"],inner=[1],outer=[2]),
age=vcat([10., 20., 30.],[10., 20., 30.].+3),
children=repeat([3,2,2],inner=[1],outer=[2]),state=[:a,:a,:a,:b,:b,:b])
x =@from i in df begin@group i by i.state into g
@select {group=g.key,mage=mean(g..age), oldest=maximum(g..age), youngest=minimum(g..age)}
@collect DataFrame
end
Hi!
sorry if this is dumb question, but I would like to do this
when really i wanted to have
mean(data)
. is there way to do this? I guess I'm looking for@transform
or@summarize
. thanks!The text was updated successfully, but these errors were encountered: