Skip to content

Instantly share code, notes, and snippets.

@tcovert
Created June 1, 2016 16:02
Show Gist options
  • Save tcovert/6df691c5308e1ddd6c5103804cc2bb05 to your computer and use it in GitHub Desktop.
Save tcovert/6df691c5308e1ddd6c5103804cc2bb05 to your computer and use it in GitHub Desktop.
using DataFrames
df = DataFrame(v1 = rand(Int16, 500),
v2 = rand(Int16, 500),
v3 = rand(Int16, 500),
v4 = rand(Int16, 500))
unique0 = size(unique(df[:, [:v1, :v2, :v3]]), 1)
unique1 = size(unique(df[:, [:v1, :v2, :v3, :v4]]), 1)
gb0 = groupby(df, [:v1, :v2, :v3])
gb1 = groupby(df, [:v1, :v2, :v3, :v4])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment