Skip to content

Instantly share code, notes, and snippets.

pdeffebach /
Last active Jul 31, 2020
Proposal for new DataFramesMeta behavior

New DataFramesMeta.jl behavior


The goal of this document is to outline proposed new behavior for DataFramesMeta and it's integration with the new DataFrames.jl "piping" functions, e.g. transform, select, combine, and filter.

Limitations of current implementation

  1. The most glaring limitation of the current behavior of DataFramesMeta is
View MWEMissings.jl
module MWEMissings
using Missings, InteractiveUtils
export TwoVectors, mapreduce_impl_bad, mapreduce_impl_good
struct TwoVectors{V}
pdeffebach / testperf.jl
Last active Mar 11, 2020
Performance of skipmissings
View testperf.jl
using BenchmarkTools, Missings
function make_x_y(N, p)
x = map(1:N) do _
rand() < p ? missing : rand()
y = map(1:N) do _
rand() < p ? missing : rand()
sx = skipmissing(x)
pdeffebach / q5.jl
Created Feb 29, 2020
bug in finding error
View q5.jl
# Question 5
module Q5
using LinearAlgebra, Distributions, DataFrames
function make_data(T, N, β, σ)
T = map(1:T*N) do i
x = rand(Normal(0, sqrt(σ)))
u = rand(Normal(0, abs(x)))
y = x * β + u
x, y
View TestGroupedTransform.jl
using DataFrames, DataFramesMeta, BenchmarkTools
function scalarfun(g::GroupedDataFrame)
@transform(g, t = :b[1])
function vectorfun(g::GroupedDataFrame)
@transform(g, t = :b .- 1.0)
You can’t perform that action at this time.