-
Notifications
You must be signed in to change notification settings - Fork 367
/
precompile.jl
37 lines (36 loc) · 1.44 KB
/
precompile.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import SnoopPrecompile
SnoopPrecompile.@precompile_all_calls begin
df = DataFrame(a=[2, 5, 3, 1, 0], b=["a", "b", "c", "a", "b"], c=1:5,
p=PooledArray(["a", "b", "c", "a", "b"]),
q=[true, false, true, false, true],
f=Float64[2, 5, 3, 1, 0])
describe(df)
names(df[1, 1:2])
sort(df, :a)
combine(df, :c, [:c :f] .=> [sum, mean, std], :c => :d, [:a, :c] => cor)
transform(df, :c, [:c :f] .=> [sum, mean, std], :c => :d, [:a, :c] => cor)
groupby(df, :a)
groupby(df, :q)
groupby(df, :p)
gdf = groupby(df, :b)
combine(gdf, :c, [:c :f] .=> [sum, mean, std], :c => :d, [:a, :c] => cor)
transform(gdf, :c, [:c :f] .=> [sum, mean, std], :c => :d, [:a, :c] => cor)
innerjoin(df, df, on=:a, makeunique=true)
innerjoin(df, df, on=:b, makeunique=true)
innerjoin(df, df, on=:c, makeunique=true)
outerjoin(df, df, on=:a, makeunique=true)
outerjoin(df, df, on=:b, makeunique=true)
outerjoin(df, df, on=:c, makeunique=true)
semijoin(df, df, on=:a)
semijoin(df, df, on=:b)
semijoin(df, df, on=:c)
leftjoin!(df, DataFrame(a=[2, 5, 3, 1, 0]), on=:a)
leftjoin!(df, DataFrame(b=["a", "b", "c", "d", "e"]), on=:b)
leftjoin!(df, DataFrame(c=1:5), on=:c)
reduce(vcat, [df, df])
show(IOBuffer(), df)
subset(df, :q)
@view df[1:3, :]
@view df[:, 1:2]
transform!(df, :c, [:c :f] .=> [sum, mean, std], :c => :d, [:a, :c] => cor)
end