Skip to content

Instantly share code, notes, and snippets.

@nalimilan
Last active April 22, 2016 14:52
Show Gist options
  • Save nalimilan/905624dd5f44b4c020d57c16fcaab498 to your computer and use it in GitHub Desktop.
Save nalimilan/905624dd5f44b4c020d57c16fcaab498 to your computer and use it in GitHub Desktop.
using DataFrames,DataFramesMeta, FreqTables
n=1000_000
y=ASCIIString[string("id",i) for i in rand(1:10,n)];
x=rand(1:10,n);
@time pda=PooledDataArray(y,UInt8);
@time f=freqtable(x);
@time f=freqtable(y);
@time f=freqtable(pda);
@time f=freqtable(x, pda);
d=DataFrame(x=P(x),y=P(y),pda=pda);
@time @by(d, :x, N=length(:x));
@time @by(d, :y, N=length(:x));
@time @by(d, :pda, N=length(:x));
@time @by(d, (:x, :pda), N=length(:x));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment