GithubHelp home page GithubHelp logo

kdpsingh / tidytable.jl Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 0.0 13 KB

Julia package that wraps the R tidytable package (tidyverse syntax with the speed of data.table)

License: MIT License

Julia 100.00%

tidytable.jl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tidytable.jl's Issues

Review benchmarks

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.