kdpsingh / tidytable.jl Goto Github PK
View Code? Open in Web Editor NEWJulia package that wraps the R tidytable package (tidyverse syntax with the speed of data.table)
License: MIT License
Julia package that wraps the R tidytable package (tidyverse syntax with the speed of data.table)
License: MIT License
Following a conversation on Julia's Slack (https://julialang.slack.com/archives/C674VR0HH/p1674245762657489), it was raised that there might be caveats on how the benchmark against DataFrames.jl was conduct.
By wrapping operations into functions, it can be seen that DataFrames.jl is actually significantly outperforming tidytable.
# base DataFrames.jl
function f0(df)
_df = subset(df, :Year => (x -> x .>= 2000))
_df = groupby(_df, :Year)
_df = combine(_df, :Budget => (x -> mean(skipmissing(x))) => :Budget)
_df = transform!(_df, :Budget => (x -> x / 1e6) => :Budget)
return _df
end
# 1.257 ms (903 allocations: 1.78 MiB)
@btime f0($movies)
# chained DataFrames.jl
function f1(df)
@chain df begin
subset(:Year => (x -> x .>= 2000))
groupby(:Year)
combine(:Budget => (x -> mean(skipmissing(x))) => :Budget)
transform(:Budget => (x -> x / 1e6) => :Budget)
end
end
# 1.279 ms (905 allocations: 1.78 MiB)
@btime f1($movies)
# tidytable
function f2(df)
@chain tidytable(df) begin
@filter(Year >= 2000)
@group_by(Year)
@summarize(Budget = mean(Budget, na.rm = TRUE))
@mutate(Budget = Budget / 1e6)
collect()
end
end
# 26.660 ms (118073 allocations: 5.40 MiB)
@btime f2($movies)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.